« See all FAQs for Rythm - One Page Responsive WordPress Theme

How to do the multiple portfolio sections?

1. Add next code to the end of functions.php file in theme’s root directory.

add_filter('rythm_portfolio_items_args', 'filter_rythm_portfolio_items');
function filter_rythm_portfolio_items($args)
{
    static $section = 0;
    $section++;

    $selected = array(1,2,3); // 1,2,3 - post IDs

    if (1 == $section) {
        // Show only selected items for portfolio section #1
         $args['post__in'] = $selected;             
    } elseif (2 == $section) {
        // Exclude selected items from portfolio section #2
        $args['post__not_in'] = $selected;
    }

    return $args;
}
Now you have to fill $selected variable with proper IDs of portfolio items you want to show in first portfolio section and exclude from the second one. Of course you also need to create two pages with template “Portfolio” from general wordpress admin panel.

2. Code example for the case with 3 portfolio sections:

add_filter('rythm_portfolio_items_args', 'filter_rythm_portfolio_items');
function filter_rythm_portfolio_items($args)
{
    static $section = 0;
    $section++;

    if (1 == $section) {
         $args['post__in'] = array(1,2,3); // Portfolio items for section #1. Do not forget to set proper post IDs
    } elseif (2 == $section) { 
         $args['post__in'] = array(4,5,6); // Portfolio items for section #2. Do not forget to set proper post IDs
    } elseif (3 == $section) {
    $args['post__in'] = array(7,8,9); // Portfolio items for section #3. Do not forget to set proper post IDs
    }

    return $args;
}
by
by
by
by
by
by