categories - Wordpress get_pages based on page category -


I need to get the WP based on that category / array of pages

I The address does not come with categories on WP pages, but I'm using it in functions.php to get categories on pages.

  add_action ('admin_init', 'reg_tax'); Function reg_tax () {register_taxonomy_for_object_type ('category', 'page'); Add_post_type_support ('Page', 'Category'); }  

Now I need to use these categories in get_pages or WP_Query to get pages in categories.

  & lt; Div class = "productNav" & gt; & Lt; Ul & gt; & Lt ;? Php $ product_page_args = array ('post_type' = & gt; 'Page', 'Order' => 'ASC', 'Orderby' = & gt; 'menu_order', 'child_of' = & gt; $ post- & Gt; id, 'category_name' = & gt; 'column-product'); // $ product_pages = get_pages ($ product_page_args); $ Product_pages = New WP_Query ($ product_page_args); Foreign currency ($ product_page $ product_pages) {? & Gt; & Lt; Li & gt; & Lt ;? Php ek $ product_page-> Post_title; ? & Gt; & Lt; / Li & gt; & Lt ;? Php}? & Gt; & Lt; / Ul & gt; & Lt; / Div & gt;  

Try it out:

  $ product_page_args = array ('Post_type' = & gt; 'Page', 'Order' = & gt; 'ASC', 'Orderby' => 'menu_order', 'child_of' => $ post-> ID, Classification '= & gt;' category ',' field '= & gt;' slug ',' word '= & gt;' column-product ');  

Comments