Styling Portfolio Taxanomies in Minimum Pro

Community Forums Forums Design Tips and Tricks Styling Portfolio Taxanomies in Minimum Pro

This topic is: not resolved

This topic contains 9 replies, has 4 voices, and was last updated by  braddalton 3 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #60811

    scotm
    Participant
    Post count: 35

    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

    • This topic was modified 12 months ago by  scotm.
    • This topic was modified 12 months ago by  scotm.
    #60816

    Anita
    Participant
    Post count: 7555

    Look for all of the CSS associated with “post-type-archive-portfolio” in the style sheet – replicate that code for your new “type”.


    When asking for help, please provide a link or screen shot showing your problem!
    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me!

    #60819

    scotm
    Participant
    Post count: 35

    @anitac

    Yes 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).

    #60820

    Anita
    Participant
    Post count: 7555

    Hold on, let me check it real quick.


    When asking for help, please provide a link or screen shot showing your problem!
    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me!

    #60822

    Anita
    Participant
    Post count: 7555

    The 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.


    When asking for help, please provide a link or screen shot showing your problem!
    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me!

    #60825

    scotm
    Participant
    Post count: 35

    I’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.

    #107506

    mattsmansfield
    Participant
    Post count: 3

    Scotm – 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

    #107531

    mattsmansfield
    Participant
    Post count: 3

    Scotm – 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

    #107822

    mattsmansfield
    Participant
    Post count: 3

    Never 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' );
    	}
    }
    #107848

    braddalton
    Participant
    Post count: 9415
Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.