Site logo

Archived topic

Hi, I want to show "Author/updated date

46 replies · Started by Rahul on February 1, 2021

Viewing posts 16–30 of 47

Hi there,

You can try creating a new Hook Element hooked to generate_before_entry_title, with display rule location set to "Posts - all posts".

You can then your HTML code within the Hook Element's code area.

Example:

<div class="disclaimer">As an Amazon Associate I earn from qualifying purchases made through the links on this page, but I only recommend the products I trust. <a href="/disclaimer">Learn more</a>.</div>

Thank you so much it really works. But the problem is the text size is large and there is much space between the thumbnail image and the text. Would you reduce the text size, and the text will show nearly the (under) thumbnail image.

Please see the attached.

Hi there,

you can reduce the space just below the featured image with this CSS:

.post-image-above-header .inside-article .featured-image {
  margin-bottom: 1em;
}

For the post title, author name, and updated date the text looks so horrible. That is why I want to show the same text "As an Amazon Associate we earn from qualifying purchases" Before the post image/thumbnail image. See the image below

I can't find which location should I have to choose?

NOTE: I don't want much space between the image and the text.

Thank you, and it works. But I don't want the search engine can crawl it. How can I "de-index" it?

Below the code.

Hi, I just told I don't want to show this text on Google search, that's why I want to "De-index" only this text "As an Amazon Associate we earn from qualifying purchases"

Please send me the code to de-index it.

You can check my website post. There you'll see it

Indexing is only for links - not content.
If you want change the meta description displayed in SERPS then you will need an SEO plugin to generate the rich snippet for search engines to use.

Hi, there is any option to show author image? Check those images

Hi, I used those all CSS but doesn't work for that I mentioned before. Forget it! Lastly, I want to show the date instead of it.(Updated On January 27, 2021 by Jordan Carter)

First will come the Author name then the date. Like this "By Jordan Carter January 27 2021"

NOTE: But if I could show the author image it would better for me!

Hi, I got a major problem. Today I updated this post, but it shows another date. Would you explain it? Please check the post.

Hi Rahul,

The code in the article I mentioned in my last reply was not all CSS, some of them are PHP code, can you confirm you insert the PHP code correctly?

This is how you add PHP snippet:
Adding PHP: https://docs.generatepress.com/article/adding-php/

Today I updated this post, but it shows another date.

I don't see another date, isn't this what you see?
https://www.screencast.com/t/1jm7Gzl4zZq

First will come the Author name then the date.

This CSS should work:

.single .entry-meta {
    display: flex;
}
.single .byline {
    order: -1;
.single .byline:after {
    content: "\00a0";
}

Then you'll need this PHP snippet to change "by" to "By":

add_filter( 'generate_inside_post_meta_item_output', function( $output, $item ) {
	if ( 'author' === $item ) {
        return ' By ';
    }
    return $output;
}, 50, 2 );

Maybe you didn't understand my last question. I was tried to explain I have updated those two articles on 07 February 2021, but the post shows old date (January 27, 2021)

It should be visible only on the last updated date. Please check those links again

This archived topic is closed to new replies.