• 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

Removing entry header for post formats

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 › Removing entry header for post formats

This topic is: not resolved

Tagged: post format

  • This topic has 9 replies, 3 voices, and was last updated 8 years, 8 months ago by RitzyThemes.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • December 29, 2014 at 8:32 am #135536
    Anonymous
    Inactive

    Hi all,

    Trying to remove the entry header for some post formats and can't seem to get things working. I'm using the sixteen nine child theme, and tried adding this to my functions.php file, but no luck.

    remove_action( 'genesis_post_title','genesis_do_post_title' );
    add_action( 'genesis_post_title','post_format_post_title' );
    /**
     * Remove Post Title with conditional tag.
     *
     */
    function post_format_post_title() {
    
    if ( has_post_format('aside') ) {
    	remove_action( 'genesis_post_title','genesis_do_post_title' );
    
    }}

    Any advice on how to do this?

    http://pedalandrevel.com
    December 29, 2014 at 9:17 am #135541
    rfmeier
    Member

    ptcjosh,

    In your code, you are attempting to remove the action while in the action callback. You will need to remove the action a little earlier to get what you are looking for. I included an example within the gist below;

    From the code you can decide what needs to be removed and/or what post formats to remove the entry header.


    Ryan Meier – Twitter

    December 29, 2014 at 9:22 am #135542
    Anonymous
    Inactive

    Thanks, Ryan. Am I missing something, not seeing the Gist?

    December 29, 2014 at 9:35 am #135543
    Anonymous
    Inactive

    I've updated things b/c I realized I wasn't using the right HTML5 hooks. I'm now at:

    remove_action( 'genesis_entry_header','genesis_do_post_title' );
    add_action( 'genesis_entry_header','post_format_post_title' );
    
    function post_format_post_title() {
    
    if ( has_post_format('aside') ) {
    	remove_action( 'genesis_entry_header','genesis_do_post_title' );
    
    }}

    This removes the title from all posts, not what I'm trying to do. Just want to remove them from selected post formats. TIA.

    December 29, 2014 at 10:12 am #135548
    rfmeier
    Member

    Gah, sorry.

    I have no idea what is going on with their forums in recent. I have had links stripped from my posts a lot lately.

    https://gist.github.com/rfmeier/4805035bd30ab7e17f76


    Ryan Meier – Twitter

    December 29, 2014 at 2:01 pm #135587
    Anonymous
    Inactive

    Thanks, Ryan. Unfortunately that didn't seem to work. Entire header info is still visible.

    December 29, 2014 at 3:18 pm #135601
    Anonymous
    Inactive

    So I have this working kind of, but not really. Basically the Gist you provided removed everything from all posts. Page titles still appear, but posts don't. Thanks again for the help.

    December 29, 2014 at 9:46 pm #135625
    rfmeier
    Member

    ptcjosh,

    I am not sure why it wasn't working for you. Are you doing this on a live site?


    Ryan Meier – Twitter

    December 30, 2014 at 6:39 am #135658
    Anonymous
    Inactive

    Hi Ryan,

    I was only using it on a local site but just pushed it to the live site so you can have a look. It seems to be removing the entry header content from all posts after the first instance of a post format encountered in the loop. You can see it here: pedalandrevel.com

    The first post is a standard post, the second an aside, the rest, standards.

    January 16, 2015 at 9:41 pm #137732
    RitzyThemes
    Member

    Hi ptcjosh,

    you can do that by simply,

    add_action( 'genesis_before_entry', 'childtheme_before_entry' );
    /**
     * childtheme_before_entry
     */
    function childtheme_before_entry() {
    
        //* get the post format
        $post_format = get_post_format(); 
    
        if ( $post_format == 'aside' ) {
            remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
            remove_action( 'genesis_post_title', 'genesis_do_post_title' );
        } else {
            add_action( 'genesis_entry_header', 'genesis_do_post_title' );
            add_action( 'genesis_post_title', 'genesis_do_post_title' );
        }
    
    }

    i hope, it will work for you.


    Get free and premium Genesis Child Themes

  • Author
    Posts
Viewing 10 posts - 1 through 10 (of 10 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

© 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