[Resolved] Post title and meta above sidebar

Home Forums Support [Resolved] Post title and meta above sidebar

Home Forums Support Post title and meta above sidebar

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #1669984
    George

    Is there a way to achieve that without using a header element? I don’t have great control over the title paddings using the header element (I also use a custom width for the single post page) plus I don’t want to lose the customizations I did on the meta.

    #1669986
    Leo
    Staff
    Customer Support
    #1669993
    George

    Yeah, I’ve tried that, all it does is duplicates the title but doesn’t take it out of the container. And I also have the post meta.

    #1670004
    Leo
    Staff
    Customer Support
    #1670008
    George

    Ok, that worked exactly like the header element. I would have to adjust the width with CSS. But what about the post meta underneath?

    I am using this example for the meta:
    https://docs.generatepress.com/article/entry-meta-style/#example-2

    #1670012
    Leo
    Staff
    Customer Support

    Does it work if you replace generate_after_entry_title with generate_after_header in the entry meta code?

    Just switching a hook.

    #1670016
    George

    generate_after_header is the one used. generate_after_entry_title just swaps meta and title position but keeps it inside the container.

    #1670018
    George

    Oh, you mean the post meta hook maybe? Switching the hook puts the meta over the title and loses the styling.

    #1670019
    Leo
    Staff
    Customer Support

    I just tried this function:

    add_action( 'wp', function() {
        if ( is_page() || is_single() ) {
            add_filter( 'generate_show_title', '__return_false' );
        }
    } );
    add_action( 'generate_after_header', function() {
        if ( is_page() || is_single() ) :
            ?>
                <div class="header-entry-title grid-container grid-parent">
                    <h1 class="entry-title"><?php the_title(); ?></h1>
                </div>
                <div class="grid-container grid-parent entry-meta">
    			    <?php generate_posted_on(); ?>
    		    </div>
            <?php
        endif;
    } );
    add_filter( 'generate_header_entry_meta_items', '__return_empty_array' );
    
    add_action( 'generate_after_header', function() {
        $header_post_types = apply_filters(
    		'generate_entry_meta_post_types',
    		array(
    			'post',
    		)
        );
    
        if ( ! in_array( get_post_type(), $header_post_types ) ) {
            return;
        }
        ?>
            <div class="entry-meta entry-meta-container grid-container">
                <div class="entry-meta-gravatar">
                    <?php echo get_avatar( get_the_author_meta( 'ID' ) ); ?>
                </div>
    
                <div class="entry-meta-info">
                    <div class="entry-meta-author">
                        <?php generate_do_post_meta_item( 'author' ); ?> in <?php generate_do_post_meta_item( 'categories' ); ?>
                    </div>
    
                    <div class="entry-meta-date">
                        <?php generate_do_post_meta_item( 'date' ); ?>
                    </div>
                </div>
            </div>
        <?php
    } );

    And this is the result:
    https://www.screencast.com/t/VShYxXqJSH

    Looks like it’s just missing the CSS styling.

    If this still doesn’t work, any chance we can revisit the issue once GP 2.0 is live?

    We really can’t be providing a custom/outdated solution like this at this point.

    Thanks for your understanding.

    #1670024
    George

    Ok, better, it lost the author gravatar (displays default one) and author name, though.

    #1670026
    George

    Ok, sure. This is not outdated solution, though, this is how GP is right now! GP 2.0 is still alpha.

    #1670027
    Leo
    Staff
    Customer Support

    it lost the author gravatar (displays default one) and author name, though

    Not sure if I understand. Is this the result you are getting?
    https://www.screencast.com/t/VShYxXqJSH

    Could we please revisit this issue once we can use the GP 2.0? We put in a lot of work for the dynamic content to avoid providing custom solution like this.

    Thanks for your understanding.

    #1670035
    George

    I have to say, it’s the only time I am not happy with support. I understand what you are saying but I think you should have provided support for existing features. The upcoming version is still alpha. I have a client handover in two days.

    You know how much I respect you and all the GP crew but in this instance, I think it was wrong to refuse support like this. I hope you take it as constructive feedback.

    #1670039
    Leo
    Staff
    Customer Support

    So what isn’t working for you?

    I added my code above with the CSS from the example doc page and this is the result:
    https://www.screencast.com/t/z1rORY4YMIP

    Is this not what you are getting?

    #1670413
    George

    I am adding the same code as you do but I get the result attached. Basically, I lose the normal avatar image (default icon is displayed) and the Author name.

Viewing 15 posts - 1 through 15 (of 22 total)
  • You must be logged in to reply to this topic.