Call a category without theme settings (2 posts)

  1. voiceofbsl
    Posted 4 years ago #

    My theme has the following code to call the category name from theme setting. I remove the setting as I wanted to disable that option to change the category ID. But I don't know hoe to call a specific category with this code?

    My theme has this code to call category from theme settings page.

    <?php $recent = new WP_Query("cat=".get_theme_mod('featuredcat')."&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>

    What should i change to set a specific category without calling it from theme settings page? Can anyone help me?

  2. Michael
    Forum Moderator
    Posted 4 years ago #


    example (for a category with the ID 27):

    <?php $recent = new WP_Query("cat=27&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.