How to make portfolio items display header underneath img?

Community Forums Forums Design Tips and Tricks How to make portfolio items display header underneath img?

This topic is: not resolved

This topic contains 6 replies, has 2 voices, and was last updated by  jmoult 1 year, 1 month ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #56394

    jmoult
    Participant
    Post count: 11

    Hi, thanks for stopping by!

    I have this code currently, I don’t know PHP so not sure how to swap things around (I would like the title below the image for each item)

    /** Add the featured image after post title */
    add_action( 'genesis_post_title', 'focus_portfolio_grid' );
    function focus_portfolio_grid() {
    	if ( has_post_thumbnail() ){
    		echo '<div class="portfolio-featured-image">';
    		echo '<a href="' . get_permalink() .'" title="' . the_title_attribute( 'echo=0' ) . '">';
    		echo get_the_post_thumbnail($thumbnail->ID, 'portfolio' );
    		echo '</a>';
    		echo '</div>';
    	}
    }

    Many thanks,
    James

    #56400

    braddalton
    Participant
    Post count: 9779

    Try genesis_before_post_title for non HTML 5 enabled themes


    #56572

    jmoult
    Participant
    Post count: 11

    Hi Brad, thanks for replying…

    I’m not quite sure I understand. Where would I place that in the code? Also, I’m using the genesis 2.0 sample theme so I assume it’s using HTML5. The PHP is from your tutorial — http://wpsites.net/web-design/add-portfolio-custom-post-type-to-focus-theme/

    Thanks !
    James

    #56575

    braddalton
    Participant
    Post count: 9779

    You’ll need to use this hook
    [php]
    genesis_entry_header
    [/php]

    So change this line:
    [php]
    add_action( ‘genesis_post_title’, ‘focus_portfolio_grid’ );
    [/php]

    To this:
    [php]
    add_action( ‘genesis_entry_header’, ‘focus_portfolio_grid’, 15 );
    [/php]

    You might need to change the 215 to another number as its the positioning parameter and place all the code at the end of your child themes files using a text editor like Notepad++


    #56582

    jmoult
    Participant
    Post count: 11

    Hi Brad,

    Thanks for the reply. Not quite sure what that achieves except making it work with HTML5?

    On the portfolio page each item is displayed with a title & image underneath, I would like the title underneath the image.

    Hope this clarifies,

    Thanks !
    James

    #56583

    braddalton
    Participant
    Post count: 9779

    Can you link to your site please. What theme are you using?


    #56584

    jmoult
    Participant
    Post count: 11

    I’m using the Genesis Sample child theme with the Genesis 2.0 Framework — Unfortunately I can’t link to my site as I’m developing it locally using MAMP.

    Thanks,
    James

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.