• 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

Paragraph tags a problem in the entry meta

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 › Design Tips and Tricks › Paragraph tags a problem in the entry meta

This topic is: not resolved

Tagged: .post-info, entry-meta, paragraph tags

  • This topic has 8 replies, 2 voices, and was last updated 7 years, 8 months ago by Brad Dalton.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • June 10, 2018 at 11:30 am #220717
    CeeDeeLight
    Member

    I love the Simple Share Buttons plugin and have used it before, but this time I need the icons to display in the entry meta. The only things on that line under the post title is the date and then the icons.

    It's easy enough adding the shortcode and then styling with CSS. The problem is that the entry meta is wrapped in paragraph tags, which forces the share icons down onto a new line.

    When I type a word next to the date, it shows up inside the paragraph tags and on the same line. When I replace it with the shortcode, the markup shows that the share icons are not inside the paragraph tags.

    // CUSTOMIZE ENTRY META HEADER
    add_filter( 'genesis_post_info', 'themeprefix_post_info_filter' );
    function themeprefix_post_info_filter( $post_info ) {
    	$post_info = '[post_date] HELLO';
    	return $post_info;
    }

    The shortcode is wrapped in divs. I thought that perhaps removing the paragraph tags and replacing them with divs would be a good fix, but I can't figure out how to remove the tags.

    Any suggestions? Thanks!!

    (My website isn't live right now. I'm using the eleven40 Pro theme.)

    June 10, 2018 at 11:37 am #220719
    CeeDeeLight
    Member

    When I use Safari's inspector tool, I can slide the div that wraps the share icons up into the paragraph tags. And when I change their width to 50%, they display inside the paragraph tags and on the same line.

    June 10, 2018 at 3:31 pm #220721
    CeeDeeLight
    Member

    I saved a copy of my parent post.php file. Then I altered that file by removing the paragraph tags from the markup array and adding the shortcode. Now it works: the date and share icons are on the same line when I adjust the CSS.

    But I couldn't successfully replicate this with the child theme. I created a child post.php file and placed it in the eleven40 Pro folder. It didn't work, so I added a structure folder inside lib, and still nothing.

    What aren't I understanding about child theme files? Grrr.

    The easier way would be a snippet in the functions file. But while I can remove the author and edit link and add the shortcode, I can't remove the paragraph tags. I'd really welcome some help with this.

    Thank you.

    June 10, 2018 at 3:33 pm #220723
    CeeDeeLight
    Member

    Sorry, I meant to share the code from the parent post.php that I altered. Where you see XXX is the location of the removed p tags.

    add_filter( 'genesis_post_info', 'do_shortcode', 20 );
    add_action( 'genesis_entry_header', 'genesis_post_info', 12 );
    add_action( 'genesis_before_post_content', 'genesis_post_info' );
    /**
     * Echo the post info (byline) under the post title.
     *
     * By default, only does post info on posts.
     *
     * The post info makes use of several shortcodes by default, and the whole output
     * is filtered via <code>genesis_post_info</code> before echoing.
     *
     * @since 1.0.0
     *
     * @return void Return early if post type lacks support for <code>genesis-entry-meta-before-content</code>.
     */
    function genesis_post_info() {
    
    	if ( ! post_type_supports( get_post_type(), 'genesis-entry-meta-before-content' ) ) {
    		return;
    	}
    
    	$filtered = apply_filters( 'genesis_post_info', '[post_date][ssba-buttons]' );
    
    	if ( false == trim( $filtered ) ) {
    		return;
    	}
    
    	genesis_markup( array(
    		'open'    => '',  XXX
    		'close'   => '',  XXX
    		'content' => genesis_strip_p_tags( $filtered ),
    		'context' => 'entry-meta-before-content',
    	) );
    
    }
    June 10, 2018 at 7:45 pm #220731
    Brad Dalton
    Participant

    I would create a custom shortcode for this rather than modify the post.php file.

    Or

    Filter the original function in your child theme.


    Tutorials for StudioPress Themes.

    June 10, 2018 at 9:08 pm #220738
    Brad Dalton
    Participant

    This is how i would code it.


    Tutorials for StudioPress Themes.

    June 11, 2018 at 12:19 pm #220758
    CeeDeeLight
    Member

    Thanks, Brad.

    So, is the idea to create a shortcode that filters the post info and removes the p tags? I would add the social share shortcode to this and then create a function that uses the new shortcode to accomplish this task?

    I struggle with ADHD and have a hard time locking in on what I'm seeing long enough to make sense of it. It's frustrating.

    The 'edit post info' code snippet provided by StudioPress doesn't filter out the p tags. The shortcode would rewrite the entire post info section, and a new function would be added that embeds this new shortcode, thereby wiping out the p tags.

    Is that correct?

    June 11, 2018 at 1:01 pm #220760
    CeeDeeLight
    Member

    For now I removed the entire post info section (what's the number for?):

    remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );

    And then I created a simple shortcode from one of your tutorials:

    function new_post_info() {
    	return '[post_date] [ssba-buttons]';
    }
    add_shortcode('new_pi', 'new_post_info');

    The p tags are gone and the date and share buttons are now on equal footing. I'll figure out how to wrap it in a div and get the buttons to display on the same line, and then maybe I'll replace the shortcode and write this out as a function that automatically places this under the entry title.

    I'm not sure this is ideal, but so far it's working. Does Yoast SEO get the post date from the entry meta only? Could doing this affect how my content appears on Google?

    June 11, 2018 at 8:49 pm #220762
    Brad Dalton
    Participant

    12 is the 3rd parameter.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 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