• Resolved champdor

    (@champdor)


    Hello,

    I have a misfortune to build a storefront webshop with 3 additional CPTs. Now my task is simple. For ‘fuszer’ CPT I want to display the loop like featured image – title – View button.

    Unfortunately the archive.php displays the CPTs like <header>title</header>, img, content which is not good.

    I’ve begun to decipher Storefront archive hierarchy like archive.php -> loop.php -> content.php -> storefront-template-functions.php -> dunno but it leads to no results where I could swap featured image and post title in archive-fuszer.php.

    Sooooo. Can you help figure out how to swap post title and featured image in CPT archive with remove/add-action? Or help build a custom archive.php for my CPT?

    Yours desperate,
    Champdor

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Did you find an answer for this @champdor?

    Having trouble finding this information myself.

    Thanks!

    Thread Starter champdor

    (@champdor)

    Yes, I found it. Basically I unhooked the featured image (post_thumbnail in Storefornt) and hooked it before the post. See code below.

    
    if ( is_single() ){
    	remove_action( 'storefront_post_content_before', 'storefront_post_thumbnail', 10 );
    	add_action( 'storefront_single_post_top', 'storefront_post_thumbnail' );
    }
    

    Then you can do some css magic to make it nice.

    Hope this helps,
    Champdor

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Simple modification of archive page for CPT’ is closed to new replies.