How to display only items (posts) from a single category?

Discussion in 'Photomaker WordPress Theme' started by dedieo62, Jul 17, 2014.

  1. dedieo62

    dedieo62 Member

    Joined:
    Apr 11, 2014
    Messages:
    158
    Likes Received:
    3
    Location:
    France
    Hello Inkthemes,

    How to have in the theme Photomaker only items (or posts) about a certain category? Or how to display only items (posts) from a single category?

    I want to appear with the widget Recent Posts only posts form a specific category. But unfortunately, I can not do it and all the posts I published (including posts which serve to illustrate the Services Page) are regularly published.

    How to display in the secondary widget area with widget Recent Posts, only the posts published in recent posts widget, and not posts used for the services page?

    Sincerely Yours,
    Dedieo62
     
  2. dedieo62

    dedieo62 Member

    Joined:
    Apr 11, 2014
    Messages:
    158
    Likes Received:
    3
    Location:
    France
    Hello there,

    I partially answer my question: I should probably use the query "query_posts" to show only the posts in a given category, and I should have to place this query <?php query_posts('cat=14');?> before the WordPress loop.

    Question: in which file should I place this query to use it in the secondary widget area? Maybe in file loop.php, but I am not sure?

    Sincerely Yours,
    Dedieo62
     
  3. Piyush

    Piyush Support Staff

    Joined:
    Dec 8, 2012
    Messages:
    4,745
    Likes Received:
    107
    Hello,

    It is not possible for us to change that in the theme because we are using the WordPress default widget in our theme.
    If you want to do some customization then go to the wp-includes/widgets.php file and edit the code as per your requirement.

    See the link for reference
    http://codex.wordpress.org/Widgets_API
     

Share This Page