Support Has Moved!

Please post all new questions on the new support system

Before posting a discussion topic, be sure to check out our Forum Rules and Support Policy.

Get design feedback and approval with our newest WordPress plugin, ProjectHuddle. Check it out →

Latest Struck Version is 1.06

Latest GridStack Version is 1.1

Latest Edition Version is 1.6

Latest District Version is 1.2.6

Latest ExtraNews Version is 1.4.9

Latest Aware Version is 1.4

Latest BigFormat Version is 1.4

Latest Bookcase Version is 1.54

Latest Ellipsis Version is 1.5

Creating a separate, second portfolio with District theme

clairedalton's Avatar

clairedalton

10 Nov, 2015 06:54 PM

Hi,

Wondering if it possible to create a second portfolio within the theme? And then assign different filters to each one - so filters with content don't show on both? You might be able to see what I mean here... I want this page to only show 'alumni' filters: http://blog.educationinireland.com/filter/alumni/ and this page not not show any of the alumni filters: http://blog.educationinireland.com/2015-student-ambassadors/ (instead this page will have items filter by country...)

Appreciate any help on this!

Thanks,

Claire

  1. 1 Posted by Eric Schmidt on 11 Nov, 2015 04:11 PM

    Eric Schmidt's Avatar

    Hi,

    I'm not sure I understand fully. Do you just want to hide the filter links? Or do you want to exclude the posts from those filters from displaying as well? You'll likely need to duplicate the template-portfolio.php file so you can setup a second page to load specific filters. We suggest using a child theme for this...

    http://support.themewich.com/kb/updating-your-theme/how-to-create-a...

    To remove filter links, you'd want to edit the wp_list_categories function and add an array of filter ID's to exclude...

     <?php wp_list_categories(array('title_li' => '', 'taxonomy' => 'filter', 'exclude' => '4,5,6', 'show_option_none'   => '', 'walker' => new Walker_Portfolio_Filter())); ?>
    

    To remove posts from those filters in the grid, you'd need to edit the WP_Query function here...

    $wp_query = new WP_Query( array( 
                        'post_type' => 'portfolio', // Portfolio Post Type
                        'orderby' => 'menu_order', // Sorted by Drag and Drop Order
                        'order' => 'ASC', // Top to Bottom
                        'posts_per_page' => $ag_page['portfolio_number'], // Get Page Number From Theme Options
                        'paged' => $paged // Get Current Page
                        ) 
                    );
    

    Add a tax_query parameter to exclude posts from that same list of filter ID's...

    $wp_query = new WP_Query( array( 
                        'post_type' => 'portfolio', // Portfolio Post Type
                        'orderby' => 'menu_order', // Sorted by Drag and Drop Order
                        'order' => 'ASC', // Top to Bottom
                        'posts_per_page' => $ag_page['portfolio_number'], // Get Page Number From Theme Options
                        'paged' => $paged, // Get Current Page
                        'tax_query' => array(
                            array(
                                'taxonomy' => 'filter',
                                'field'    => 'term_id',
                                'terms'    => array( 4, 5, 6 ),
                                'operator' => 'NOT IN',
                            ),
                        ),
                        ) 
                    );
    

    Eric

  2. 2 Posted by clairedalton on 18 Nov, 2015 10:08 PM

    clairedalton's Avatar

    Hi Eric,

    Thanks for your reply. A few more questions…

    I don’t fully understand how the inheritance process works… I have duplicated the template-portfolio.php and added it to the child theme directory but when I edit that it impacts all portfolio pages on the site, as it’s now the main portfolio template and overrides the parent copy? I don’t know how to create a new (second) portfolio page that looks at a separate version of template-portfolio.php - everything is looking at the child version now.

    Were you suggesting that I could create one portfolio page to reference the parent copy and another portfolio page to reference the child?

    Apologies, I’m new to all this - thanks for your help so far, much appreciated!

    Claire

  3. 3 Posted by Eric Schmidt on 19 Nov, 2015 03:55 PM

    Eric Schmidt's Avatar

    Hi,

    I should have explained that a little better. If you copy the file and name it template-portfolio.php, that will override the parent and only use that. To create a second version you can use on a per-page basis, name that something else in your child theme, like template-portfolio-new.php. Then edit that file and change the name at the very top here...

    /* 
    Template Name: Portfolio Page
    */
    

    To something like...

    /* 
    Template Name: New Portfolio Page
    */
    

    This will add an additional option to the Page Template dropdown, so you can still use the original portfolio page template, but also create a new page and have it use this new template that you've made edits to. Hopefully that makes a little more sense.

    Eric

  4. System closed this discussion on 03 Dec, 2015 04:00 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac