Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

how to display one portfolio set on a page. WordPress

  • SOLVED

my question is it is possible to show only 1 portfolio set/category in a page?

I already ask for this 3 years ago and it was working, but after a theme update i lost the ability to display just one portfolio set on an specific page.

here is the page with all portfolios http://miamiquincesphotography.com/quinceaneras-photography/

and what i need is a new page to display just one of those portfolios categories,in this case just display or show vizcaya portfolios http://miamiquincesphotography.com/vizcaya/

Thank you in advance

Answers (3)

2016-02-05

Reigel Gallarde answers:

[[LINK href="http://miamiquincesphotography.com/vizcaya/"]]vizcaya[[/LINK]] is already working... you want to display this on another page?


lchales comments:

Yes, the page is working but is displaying all portfolios


Reigel Gallarde comments:

can you give me a link of vizcaya when you edit this category name on dashboard... I need it's taxonomy and id. That link will provide it.


Reigel Gallarde comments:

$args = array(
'numberposts' => $portfolio_items,
'order' => 'ASC',
'orderby' => 'menu_order',
'post_type' => array(
'portfolios'
) ,
);

duplicate your file portfolio-4.php. On the copied file, change the Template Name "Portfolio 4 Columns" to something else.

look for this code..
$args = array(
'numberposts' => $portfolio_items,
'order' => 'ASC',
'orderby' => 'menu_order',
'post_type' => array(
'portfolios'
) ,
);


change it to something like this

$args = array(
'numberposts' => $portfolio_items,
'order' => 'ASC',
'orderby' => 'menu_order',
'post_type' => array(
'portfolios'
) ,
'tax_query' => array(
array(
'taxonomy' => 'custom_taxonomy',
'field' => 'name',
'terms' => 'vizcaya',
),
),
);


please take note, you have to change 'custom_taxonomy' here to your taxonomy. You will find it written on the link when you edit vizcaya on the dashboard. also, if using 'name' will not work, try 'slug' on the 'field'.

after you saved this, upload it to your theme files, then use it as your template.


lchales comments:

edit-tags.php?action=edit&taxonomy=portfoliosets&tag_ID=175&post_type=portfolios&wp_http_referer=%2Fwp-admin%2Fedit-tags.php%3Ftaxonomy%3Dportfoliosets%26post_type%3Dportfolios


Reigel Gallarde comments:

it is also better to do your edits on [[LINK href="https://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme"]]a child theme[[/LINK]]. This way, if your theme has updates, your edits will not be affected or lost.


Reigel Gallarde comments:

you can use this tax_query... based on my code and instructions above..

tax_query' => array(
array(
'taxonomy' => 'portfoliosets',
'field' => 'term_id',
'terms' => '175',
),
),


lchales comments:

So far this is working http://miamiquincesphotography.com/vizcaya/ but not in the way it was before.

Before i select via "Custom Field" the portfolio i want to display on an specific page.


Reigel Gallarde comments:

I have read comments from theme where that can be purchased. [[LINK href="http://themeforest.net/item/nemesis-clean-design-for-creative-designer/2577225/comments?page=48&filter=all#comment_4715031"]]Specifically this comment[[/LINK]]. And the author, just gave a link, which is [[LINK href="http://codex.wordpress.org/Template_Tags/get_posts#Taxonomy_Parameters"]]this get_posts#Taxonomy_Parameters[[/LINK]] .


lchales comments:

Reigel, i really like this approach to my problem but i still need help implementing or setting the Custom Field to select the specific portfolio i want to display, any help?


Reigel Gallarde comments:

Do you have your custom fields setup? That is, is there a meta box that says custom field when you add or edit a page? If not, please check if it has "Custom Fields" option in the "Screen Options" upper right of the editor when adding or updating page.

Let me know. I will prepare a code...


lchales comments:

I think i do