Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #13860

    Hey Kriesi & team.

    Since building my site last year, I’ve only ever had 1 single Portfolio page, Features:

    However, I’ve decided that I also want to add another one, Case Studies

    The problem right now is that even though (I think) I’ve set up the Portfolio Prefs correctly…


    …each Portfolio page displays the categories for ALL portfolio items:

    Show: All | Case Study | Code | Designer | Developer | Organisation | UI

    Is this how it should be? And if so, what PHP do I need to add to template-portfolio.php to limit each page to its chosen categories?

    Many thanks,



    Hi Dave,

    Do you by chance have “Portfolio” selected under Template when you click on Pages > Case Studies? If so, set that to “Default Template” then refresh the page and see if that works.




    Brilliant! Thanks Mya, that’s the last thing I would have thought of.

    It seems a little counter-intuitive though, as the page is clearly using template-portfolio.php. Does setting the portfolio template instruct the page to use ALL items in that case?

    Also, I’m not quite sure what “Enter a page slug that should be used for your portfolio single items” means, now I have 2 lots of portfolio pages.





    Yes, portfolio pages are using the template-portfolio.php. If you choose Template > Portfolio it will override the settings on your theme options and will show all of your portfolio items with the default settings 3 columns.

    This code in template-portfolio.php is responsible for that one.

    //set a deafult query with all portfolio items in case the user just selected to display the page tempalte instead of stting up a portfolio properly
    if(!isset($avia_config['new_query']['tax_query'][0]['terms'][0]) || $avia_config['new_query']['tax_query'][0]['terms'][0] == "null")
    $avia_config['new_query'] = array("paged" => get_query_var( 'paged' ), "posts_per_page"=>-1, "post_type"=>"portfolio");

    When you enter a slug, it will add that slug on the permalink for each portfolio item.




    The portfolio slug option allows you to customize the permalinks for portfolio items a bit. Eg many users don’t want to call their portfolio entries “portfolio-items” but the (standard) slug suggests this name. Eg you could insert “projects” instead and then the permalink will be instead of


    Hi guys,

    Thanks for the info. I actually realised yesterday what the slug was about once both my portfolio sections linked to portfolio items with the same leading slug segment.

    My suggestion for any Broadscope update would be to allow the user to select a slug per-portfolio page, i.e.:

    – features/feature-1

    – case-studies/case-study-1

    And they could always just type the same slug if they wanted a global slug, like:

    – portfolio-item/feature-1

    – portfolio-item/case-study-1

    Anyway, thanks for getting back to me. I might try and think how to hack this one, but for the time being, I have the separate portfolios working, so that will do!





    Thanks for the suggestions. I will tag Kriesi. :)



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

The topic ‘PHP code for separate portfolio pages’ is closed to new replies.