Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #21039

    Is there a way to list 2 categories on a page template (similar to the portfolio section), but have only posts from those 2 categories show up. In other words, I have the category Holland and then I have different categories for tour types in Holland. I want a page that lists posts categorized with Holland and then a particular tour type. I don’t want the page to include all Holland posts and all the posts from a particular tour. Just posts with both of those categories.

    Is this possible?

    #110191

    You can change the post query but this will affect all blog elements. Open up wp-contentthemesbrightboxincludeshelper-templates.php and replace following code:

    $avia_config['new_query'] = "posts_per_page=".$dynamic_blog_posts_per_page."&paged=".get_query_var( 'paged' );

    if($dynamic_blog_cats != 'null' && $dynamic_blog_cats != '')
    {
    $avia_config['new_query'] .= '&cat='.$dynamic_blog_cats;
    }

    with:

    $avia_config['new_query']['posts_per_page'] = $dynamic_blog_posts_per_page;
    $avia_config['new_query']['paged'] = get_query_var( 'paged' );

    if($dynamic_blog_cats != 'null' && $dynamic_blog_cats != '')
    {
    $dynamic_blog_cats = explode(",", $dynamic_blog_cats);
    $avia_config['new_query']['category__and'] = $dynamic_blog_cats;
    }

    #110192

    I am not actually seeing a change here. What does this change effect?

    Thanks!

    #110193

    Hi bacem,

    I’m not sure if Dude understood you correctly but I think what you are trying to do is show only posts that are in X and Y categories but not show them if they only have X or only have Y correct?

    If that is the case, your best option is to instead just create a single to category. I’m not actually sure you’d be able to modify the theme otherwise.

    Regards,

    Devin

    #110194

    Thanks Devin. I found a workaround by reorganizing categories.

    #110195

    Glad you found a solution that works for you :)

    Let us know if you have any other questions or issues.

    Regards,

    Devin

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘On the template builder, include multiple categories?’ is closed to new replies.