Comments 2Edorta started the conversationMarch 24, 2017 at 1:25amHey! Could I exclude an specific category from the portfolio and create an url where I can only see that category? Thank you very much! Regards,Edorta 1,974Support repliedMarch 24, 2017 at 9:12pmHello Edorta,yes, you can.To have a specific url to a category page, just add the category name at the end of /portfolio_category.For examplehttp://clapat.ro/berger-wordpress/portfolio_category/branding/to exclude a category from the portfolio page is a bit more complicatedIf you open portfolio-page.php you need to modify two queries:first the one that selects all categories: $portfolio_category = get_terms('portfolio_category', array( 'hide_empty' => 0 ));https://developer.wordpress.org/reference/functions/get_terms/#parameterssee 'exclude' parameterSecond is to modify the arguments of the query that selects all portfolio posts:$args = array( 'post_type' => THEME_ID . '_portfolio', 'paged' => $paged, 'posts_per_page' => 1000, );http://wordpress.stackexchange.com/questions/142484/exclude-custom-taxonomieshttps://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_ParametersThank you. Clapat Support https://www.clapat.com/ Review Envato Item Support Policy Sign in to reply ...
Hey!
Could I exclude an specific category from the portfolio and create an url where I can only see that category?
Thank you very much!
Regards,
Edorta
Hello Edorta,
yes, you can.
To have a specific url to a category page, just add the category name at the end of /portfolio_category.
For example
http://clapat.ro/berger-wordpress/portfolio_category/branding/
to exclude a category from the portfolio page is a bit more complicated
If you open portfolio-page.php you need to modify two queries:
first the one that selects all categories:
$portfolio_category = get_terms('portfolio_category', array( 'hide_empty' => 0 ));
https://developer.wordpress.org/reference/functions/get_terms/#parameters
see 'exclude' parameter
Second is to modify the arguments of the query that selects all portfolio posts:
$args = array(
'post_type' => THEME_ID . '_portfolio',
'paged' => $paged,
'posts_per_page' => 1000,
);
http://wordpress.stackexchange.com/questions/142484/exclude-custom-taxonomies
https://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters
Thank you.
Clapat Support
https://www.clapat.com/
Review Envato Item Support Policy