Community Forums › Forums › Archived Forums › Design Tips and Tricks › Styling Portfolio Taxanomies in Minimum Pro
- This topic has 9 replies, 4 voices, and was last updated 9 years, 10 months ago by Brad Dalton.
-
AuthorPosts
-
September 5, 2013 at 6:35 am #60811scotmMember
I want to categorize my portfolio items in Minimum Pro by way of a new taxonomy.
To do this, I've created a new taxonomy in my functions.php file called "Type". I then duplicated the archive-portfolio.php template file and renamed it taxonomy-portfolio-type.php. This works fine, as I can now categorize my portfolio items in various categories under Type.
However I need some guidance on how to style these posts in the taxonomy archive template and my style sheet so that they appear the same as the existing archive template.
A tutorial on how to do this appears here: http://bit.ly/17GTfW2
Cheers
September 5, 2013 at 7:21 am #60816AnitaKeymasterLook for all of the CSS associated with "post-type-archive-portfolio" in the style sheet - replicate that code for your new "type".
Love coffee, chocolate and my Bella!
September 5, 2013 at 7:31 am #60819scotmMemberYes I figured that would be the route to go, but was unsure of the class name to use for the taxonomy when duplicating the css (e.g. post-type-archive-portfolio-type).
September 5, 2013 at 7:32 am #60820AnitaKeymasterHold on, let me check it real quick.
Love coffee, chocolate and my Bella!
September 5, 2013 at 7:39 am #60822AnitaKeymasterThe current Archive Portfolio file name is archive-portfolio.php. So I am thinking you will need to change it to the file name you created "post-type-taxonomy-portfolio-type". If that doesn't work use just use the word "type" but if I were you, to cut down on confusing words, maybe create a new name for the custom post type instead of the word type.
Love coffee, chocolate and my Bella!
September 5, 2013 at 7:55 am #60825scotmMemberI'm using "type" for testing purposes only and had seen the potential conflict with the names. So you're saying, for example, to try:
".post-type-taxonomy-portfolio-type .entry" to replace an instance of ".post-type-archive-portfolio .entry"
This doesn't appear to work. Curious that firebug shows the <div class="portfolio-image"> in the portfolio archive template but there's no reference to that in the stylesheet.
May 30, 2014 at 10:42 am #107506mattsmansfieldMemberScotm - did you ever solve this? Thanks to your excellent link above, I have everything worked out, but the grid is not working on the taxonomy archive page - each portfolio item appears on a page by itself with a "Next" page numerical navigation beneath it.
Thanks in advance for any help you can provide!
-Matt
May 30, 2014 at 12:25 pm #107531mattsmansfieldMemberScotm - did you ever solve this? Thanks to your excellent link above, I have everything worked out, but the grid is not working on the taxonomy archive page - each portfolio item appears on a page by itself with a "Next" page numerical navigation beneath it.
Thanks in advance for any help you can provide!
-Matt
June 2, 2014 at 8:31 am #107822mattsmansfieldMemberNever mind - I figured it out. I needed to replicate some code in the child theme's functions.php:
//* Change the number of portfolio items to be displayed (props Bill Erickson) add_action( 'pre_get_posts', 'minimum_portfolio_items' ); function minimum_portfolio_items( $query ) { if ( $query->is_main_query() && !is_admin() && is_post_type_archive( 'portfolio' ) ) { $query->set( 'posts_per_page', '6' ); } }
Here's the code I added:
//* Change the number of portfolio-category items to be displayed (props Bill Erickson) add_action( 'pre_get_posts', 'minimum_portfolio_category_items' ); function minimum_portfolio_category_items( $query ) { if ( $query->is_main_query() && !is_admin() && is_tax( 'portfolio-category' ) ){ $query->set( 'posts_per_page', '6' ); } }
June 2, 2014 at 10:48 am #107848 -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.