• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

In Showcase Pro – move entry info after the title

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › In Showcase Pro – move entry info after the title

This topic is: resolved

Tagged: .post-info, entry-meta, Showcase Pro

  • This topic has 7 replies, 2 voices, and was last updated 6 years, 1 month ago by macrunner.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • August 18, 2017 at 8:17 am #210512
    macrunner
    Participant

    Hi,
    I'm customizing the Showcase Pro theme.
    In the functions.php file I have added some features that I then view through shortcodes and everything is working fine.

    function showcase_entry_meta_header($post_info) {
    	$post_info = '[post_categories before="" after=" ·"] [post_date] [post_edit before=" · "] · Post of [word_count] words · View [postview]';
    	return $post_info;
    }

    In the following picture you can see the edit that I would like to make: http://imgur.com/a/6u6er

    In practice, I would like to move shortcodes just below the title.

    To do this, I opened the single.php file that contains:

    // Add page header
    add_action( 'genesis_after_header', 'showcase_single_page_header', 8 );
    function showcase_single_page_header() {
    	$output = false;
    
        $image = get_post_thumbnail_id();
    
        if( $image ) {
    
            // Remove the title since we'll add it later
            remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    
            $image = wp_get_attachment_image_src( $image, 'showcase_hero' );
            $background_image_class = 'with-background-image';
            $title = the_title( '<h1>', '</h1>', false );
            
            $output .= '<div class="page-header bg-primary with-background-image" style="background-image: url(' . $image[0] . ');"><div class="wrap">';
            $output .= '<div class="header-content">' . $title . '</div>';
            $output .= '</div></div>';
        }
    
    	if( $output )
    		echo $output;
    }
    

    I have done many tests, I've followed many tutorials and guides but no positive results.

    The site I'm working on: http://demo.maexen.com/dev/simple/

    Thanks for any help or suggestion.

    August 18, 2017 at 2:46 pm #210524
    Brad Dalton
    Participant

    Hi

    This is the code to use to remove the post info https://my.studiopress.com/documentation/snippets/entry-header-html5/remove-entry-meta/

    You can then add it back using any genesis hook

    Not sure why you posted the code for the image?


    Tutorials for StudioPress Themes & WooCommerce.

    August 18, 2017 at 11:33 pm #210532
    macrunner
    Participant

    Hi,

    This is the original code that is in single.php and shows the image featured and over the Title:

    add_action( 'genesis_after_header', 'showcase_single_page_header', 8 );
    function showcase_single_page_header() {
    	$output = false;
    
        $image = get_post_thumbnail_id();
    
        if( $image ) {
    
            remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    
            $image = wp_get_attachment_image_src( $image, 'showcase_hero' );
            $background_image_class = 'with-background-image';
            $title = the_title( '<h1>', '</h1>', false );
            
            $output .= '<div class="page-header bg-primary with-background-image" style="background-image: url(' . $image[0] . ');"><div class="wrap">';
            $output .= '<div class="header-content">' . $title . '</div>';
            $output .= '</div></div>';
        }
    
    	if( $output )
    		echo $output;
    }

    I was thinking of this change:

    add_action( 'genesis_after_header', 'showcase_single_page_header', 8 );
    function showcase_single_page_header() {
    	$output = false;
    
        $image = get_post_thumbnail_id();
    
        if( $image ) {
    
            remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    
            $image = wp_get_attachment_image_src( $image, 'showcase_hero' );
            $background_image_class = 'with-background-image';
            $title = the_title( '<h1>', '</h1>', false );
            
            $output .= '<div class="page-header bg-primary with-background-image" style="background-image: url(' . $image[0] . ');"><div class="wrap">';
            $output .= '<div class="header-content">' . $title . '</div>';
    
    // here, where I thought I would insert my shortcode, for example:
            $output .= '<div class="mycustomcss">' . '[post_categories before="" after=" &middot;"] [post_date] [postview]' . '</div>';
    
            $output .= '</div></div>';
        }
    
    	if( $output )
    		echo $output;
    }

    But showing the code shortcode, not the content, date, categories etc:
    Post title
    [shortcode 1] [shortcode 2]

    demo.maexen.com/dev/simple

    Definitely I'm using wrong codes, i should understand how to enter shortcode here:

    $output .= '<div class="mycustomcss">' . Here i would like to enter my shortcode . '</div>';

    August 19, 2017 at 12:31 am #210534
    Brad Dalton
    Participant

    Try do_shortcode with position relative.


    Tutorials for StudioPress Themes & WooCommerce.

    August 19, 2017 at 1:42 am #210536
    macrunner
    Participant

    I think the problem that I can not solve is that my code does not show the shortcode content:

    $output .= '<div class="mycustomcss">' . '[post_categories before="" after=" &middot;"] [post_date] [postview]' . '</div>';

    screen

    I do not know how to show my shortcode in $output .=

    August 19, 2017 at 2:03 am #210537
    Brad Dalton
    Participant

    Try this tutorial


    Tutorials for StudioPress Themes & WooCommerce.

    August 19, 2017 at 3:01 am #210538
    macrunner
    Participant

    Now I understand my mistake, I used:

    $output .=

    But I should have used it:

    $meta =

    as indicated in your tutorial.
    Now it works fine, thank you very much.

    August 19, 2017 at 3:06 am #210539
    macrunner
    Participant

    I have noticed now, the only problem, appears twice the title, once in the header and once in the content

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘In Showcase Pro – move entry info after the title’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble