0

I am thinking of something.that i want to add a wordpress admin menu for set category id. i mean i designed news section that lists post from specific category.

like this:

Sports News

  • Post from sports news Title 1
  • Post from sports news Title 3
  • Post from sports news Title 3
  • Post from sports news Title 4

Market News

  • Post from Market news Title 1
  • Post from Market news Title 3
  • Post from Market news Title 3
  • Post from Market news Title 4

so when someone else uses the theme and create new category the id will be deferent.

$args=array(
    'posts_per_page' => 5, 
    'post_type' => 'my_custom_type'
    'cat' => $cat_id,// i,m talking about this category id changeing option menu/page
);
$wp_query = new WP_Query( $args );

is there any way adding a option menu to set category id based on section. so i admin can set category id to show post in frontend. thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.