Deprecated: Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead. in /var/www/html/wp-includes/functions.php on line 5383

Separating portfolio on to different pages

New Front EN Support Forums Sensei Theme Support Separating portfolio on to different pages

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6720

    Hi,

    I’d like to divide the portfolio into categories, with each category displayed on a separate page, rather than using the tag filters on the one page. Is there a way I can do this?

    Any help would be most appreciated!

    Thanks.

    #6723
    mmsatori
    Keymaster

    Hey Percy,

    this has not been envisaged as an out-of-the-box theme feature, but technically it is possible to achieve. Since it is a theme customization, it is unfortunately outside the ThemeForest support offer, but I will try to guide you through the best I can. In order to create a portfolio page that only displays projects with a certain tag, you will need to create a copy of the portfolio page template (pick any of the existing four, depending on how many columns you need), give the new file a unique name, edit the name on line 1 of the new file to make it unique as well (WordPress does not allow duplicate page template names). Then, you will need to modify the loop on line 40 of the file (the line should start with “$loop”); change it from

    $loop = new WP_Query(array('post_type' => 'project', 'posts_per_page' => -1));
    

    to

    $loop = new WP_Query(array('post_type' => 'project', 'posts_per_page' => -1,'tax_query' => array(	array('taxonomy' => 'tagportfolio','field' => 'id', 'terms' => 'XX',),),));
    

    replacing “XX” with the ID of the tag that you need to filter the page projects by. You can find the tag ID by clicking on the tag in the “Portfolio->Tags” admin section: the number after “&tag_ID=” in the browser’s address bar is the tag ID you need.

    After you have the file ready, you can upload it into the theme folder (/wp-content/themes/Sensei/), then create a new page and select the new template name in the “Page Attributes” box on the right. Voila! :)

    Should you encounter problems along the way, do not hesitate to contact me!

    Sincerely,
    Andrii / Satori Studio

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.