Site logo

Archived topic

How to change the position of META info and add the end line

27 replies · Started by nutt on July 2, 2020

Viewing posts 1–15 of 28

I would like META info (date and author) from below title to end of the content and add the line just like
-> seths.blog

Thank you

Both archive page and post page

Thank you

Hi there,

you can use this snippet to add the meta to the footer:

add_filter( 'generate_footer_entry_meta_items', function() {
    return array(
        'date',
        'author',
        'post-navigation',
    );
} );

and add this to remove any meta below the title:

add_filter( 'generate_header_entry_meta_items', function() {
    return '';
} );

Make sure Date and Author are set to display for them to show.

After thats done - share a link to your site and ill take a look at the CSS for styling.

Hi. How can show the tags list after the single post? By default it was showing previously but right now not showing. You can check out the site: https://www.gadgetheadline.com/

Thanks in advance.

Thank you so much David

this is my site -> https://nuttblog.com

this is the position I want the META to be
[img]https://sv1.picz.in.th/images/2020/07/02/5gRIHJ.jpg[/img]

and I want them to show in archive page (front page) as well

Hi Rohan - can you raise a separate topic and we will assist directly.

JJ - can you make sure you have Author and Date meta set to display for Archives in Customizer > Layout > Blog?

How is the Social Share added to the site ? Can it be added using a shortcode ? If so use that method and it to the after_content hook using a hook element

Date and Author are set to display for archive already but it doesn't show.

Social share is from jetpack plugin which I don't know how to change the position of it

Thank you David

Are you using any other functions for the meta? Can you link us to the page in question?

Social share is from jetpack plugin which I don’t know how to change the position of it

You will need to check with JetPack's support to see if there is a way to insert the social share content using a function or shortcode so we can add it using hook and order it the way you want.

This is what it said in Jetpack

"By default, the sharing icons will display right at the bottom of your post’s content. You may want to move it elsewhere in your post, such as right before the content.

To do this, in your functions.php file, add the following:

function jptweak_remove_share() {
    remove_filter( 'the_content', 'sharing_display', 19 );
    remove_filter( 'the_excerpt', 'sharing_display', 19 );
    if ( class_exists( 'Jetpack_Likes' ) ) {
        remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );
    }
}
add_action( 'loop_start', 'jptweak_remove_share' );

Then find the file for the location where you’d like the sharing icons to appear. Insert the following code in the area you want the Sharing or Likes buttons to appear:

if ( function_exists( 'sharing_display' ) ) {
    sharing_display( '', true );
}
 
if ( class_exists( 'Jetpack_Likes' ) ) {
    $custom_likes = new Jetpack_Likes;
    echo $custom_likes->post_likes( '' );
}
add_action( 'loop_start', 'jptweak_remove_share' );

Please note that this is provided as a courtesy and we do not provide support for implementing or editing custom code."

Can you tell me where to put the code in GP?

Thank you so much

This is what I would like it to look like

1. one border separator line right at the end of the post (Archive page and Post page)
2. The date displayed under the line
3. Social Share under the line

Thank you so much :)
[img]https://sv1.picz.in.th/images/2020/07/03/5i9vfn.jpg[/img]

Please help

Add this code:

if ( function_exists( 'sharing_display' ) ) {
    sharing_display( '', true );
}

to the after_content hook in a hook element. Make sure to Check Execute PHP and set your display rules. That will place the shares below.

Can you enable the post meta to display?

I already enable post meta but it doesn't show, I don't know why?

Can you remove any custom functions for the post meta you have added apart form those related to Jetpack.

Done but the latest code didn't work too

This archived topic is closed to new replies.