[Resolved] Remove entry header in post

Home Forums Support Remove entry header in post

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

    Hi Guy’s,

    I’ve created a header element to use for some posts. In the header i’ve added all post meta like author and date with the template tags. (works great btw!)

    But now i would like to remove the entry-header/ entry-meta which is added in the post since this information is already in the header.

    Any idea how i can achieve this?

    Thanks,
    Ronny

    #1105726
    David
    Staff
    Customer Support

    Hi there,

    when using the Template Tags it should automatically remove entry-header/meta unless you have any functions that change that behaviour.

    Can you share a link to the site?

    #1105898
    Ronny

    I’ve added the url in the first post.

    I have these filters which maybe can cause this behavior:

    //add author image in blog post header
    add_filter( ‘generate_post_author_output’, function() {
    return sprintf( ‘ <span class=”byline”>%1$s</span>’,
    sprintf( ‘<span class=”author vcard” itemtype=”http://schema.org/Person&#8221; itemscope=”itemscope” itemprop=”author”>%4$s<span class=”author-name” itemprop=”name”>%3$s</span></span>’,
    esc_url( get_the_author_meta( ‘ID’ ) ),
    esc_attr( sprintf( __( ‘View all posts by %s’, ‘generatepress’ ), get_the_author() ) ),
    esc_html( get_the_author() ),
    get_avatar( get_the_author_meta( ‘ID’ ) )
    )
    );
    } );
    add_filter( ‘generate_header_entry_meta_items’, function() {
    return array(‘author’,’date’,);
    } );
    add_filter( ‘generate_footer_entry_meta_items’, function( $items ) {
    return array(‘date’,’categories’,);
    } );
    /* remove link in published date */
    add_filter( ‘generate_post_date_output’,’tu_remove_date_link’, 10, 2 );
    function tu_remove_date_link( $output, $time_string ) {
    printf( ‘<span class=”posted-on”>%s</span>’,
    $time_string
    );
    }

    #1106322
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Those functions shouldn’t prevent the Header Element from removing the default meta.

    Can you share the content you’ve added to your Header Element?

    #1106476
    Ronny

    Yeah, sure:

    <div class="row">
    	<div class="column">
    		<div class="hover"><p>Koopgids</p></div>
    		<h1>{{post_title}}</h1>
    		<p class="underline">Door: Author | Laatste update: {{post_date}}</p>
    		<p style="intro">{{custom_field.hero_intro}}</p>
    		<a class="button">Lees verder</a>
    	</div>
    	<div class="column">{{custom_field.featured_image}}</div>
    </div>
    <div class="scroll-down">
    			<svg xmlns="http://www.w3.org/2000/svg" width="21.939" height="24.28" viewBox="0 0 21.939 24.28"><defs><style>.a{fill:#1ca5fc;}</style></defs><g transform="translate(-10.639)"><path class="a" d="M21.608,106.776,32.578,95.807l-3.112-3.112-7.857,7.858-7.857-7.858-3.112,3.112Z" transform="translate(0 -82.496)"/><path class="a" d="M32.578,3.112,29.466,0,21.608,7.858,13.751,0,10.639,3.112,21.608,14.081Z"/></g></svg>
    </div> 
    #1106484
    Ronny

    Hi Tom,

    Found the problem. I didn’t use the {{post_author}} field but a fixed text..

    Sorry for wasting your time..

    Kind regards,
    Ronny

    #1107037
    Tom
    Lead Developer
    Lead Developer
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.