Specific category in carousel?

Discussion in 'Infoway WordPress Theme' started by gudiker, Mar 6, 2013.

  1. gudiker

    gudiker New Member

    Joined:
    Mar 5, 2013
    Messages:
    4
    Likes Received:
    0
    Hi, Im a bit noob in this, I got the infoway theme and it worked perfectly! However, I'd like to show a specific category in the featured carousel.

    is there any way possible to do that?

    Thanks
     
  2. Harmeet

    Harmeet Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    360
    Likes Received:
    15
    Hello,

    The carousel shows only those posts which is added recently, so it won't show the post according to the category.
     
  3. rossjamesparker

    rossjamesparker New Member

    Joined:
    Jul 14, 2013
    Messages:
    1
    Likes Received:
    0
    Actually, this is possible. I have just discovered how to do it, because I wanted to do it to.

    You need to know the category ID that you want to focus on (in my case that is test). Then you go into front-page.php and find the section:

    $args = array(
    'post_status' => 'publish',
    'posts_per_page' => -1,
    'order' => 'DESC'
    );

    Then add the line:

    'category_name' => 'test',

    ...in the list of arguments (e.g. between lines 2 and 3 of the code above).

    You can also use the 'cat' => '22', if you know the page slug.

    You should also be able to exclude categories, by adding negative page slugs, e.g.

    'cat' => '-22',

    I haven't tested this last bit.

    Hope this helps!
     

Share This Page