Reply To: Separating portfolio on to different pages

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

#6723
satori
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