Archived topic
How to display post date/revision date in generateblocks
20 replies · Started by robchanoi on July 26, 2021
Hi - using GB loses functionality of GP when selecting "display post date" "author" etc - is there a way to have these feature top of post. Posts are in containers. Would also like revision date to show not original date.
Tks.
Hi there,
use a Block Element to create your own post meta:
https://docs.generatepress.com/article/block-element-post-meta-template/
Thanks David. Followed the vid to set up post date but not happening. Just not appearing. Played around somewhat but hit a brick wall.
Which Hook did you select to display the Post meta block ?
A block hook. I think because I have the post in a container pushed up into the top container it's causing problems. Without this margin adjustment it works but setting margin offset against post container doesn't seem to work.
Hi there,
I'm not sure I'm following what you're trying to do.
To clarify: I believe you simply what to add a post meta?
Here's a demo video of what David suggested - https://share.getcloudapp.com/RBuloXeB
Any chance you can let us have a look at the Block element template you've made?
You can use the private information text field to provide the details.
I am trying to have the post date/revision date feature at top of posts.
Ticking GP "display date" box doesn't work.
Creating block element in this vid - https://docs.generatepress.com/article/block-element-post-meta-template/ - works but if post in container is pushed up into top container like the link to the post I left you you will see that it doesn't feature.
This is what I am trying to resolve.
Hi there,
Checked your site, I would recommend a better way to achieve your current layout:
https://www.screencast.com/t/L3VdR2GC
You are manually adding the red part and blue part to each post, this works, but there's a dynamic way to do this -- using a block element - page hero.
And you can add post meta (date/author) into the same page hero.
https://docs.generatepress.com/article/block-element-page-hero/
Hope this helps!
Thanks Ying. I've got it to appear but it remains fixed at the top in the header.
Changing the "quick hook select" and the "hook name" doesn't seem to shift it.
Could you kindly advise which settings it requires to feature in the first or second container, and then I can position using padding/margins.
Or if its assigned to page hero it will remain at the top and must be positioned as is?
Thanks.
I’ve got it to appear but it remains fixed at the top in the header.
I'm not seeing it on your site, did you clear your cache?
Or if its assigned to page hero it will remain at the top and must be positioned as is?
Yes.
Can you link me to where I can see the position issue?
Let me know :)
Yes I disabled it as it looked out of place. Showing again now.
Right, so should I choose a different "element type"?
I'm slightly confused also. Should I be choosing "page hook" or "post meta data" as per either video links posted here?.
I am trying to set this up for "posts" and "woocommerce product pages" - to have updated date feature. Product pages are using page heros as no GB function and posts are using containers and then header elements to merge header.
Edit: update time is lagging when I make changes, so that certain "quick hook select" and "hook name" settings aren't showing straight after update.
Block Elements have the same behaviour as Hooks, in that they can be Hooked into the same places.
The Element Type eg. Page Hero, Post Meta etc are:
1. A shortcut to setting up their position, eg a Page Hero, use the same as a Hook: after_header.
2. Provide additional Element Type options. eg. a Page Hero, provides the options to remove The Title and Featured Image fro the post content.
Following what Ying suggested, you should use a Page Hero Element Type.
You will still require the Header Element for the Merged site header.
You are manually adding the red part and blue part to each post, this works, but there’s a dynamic way to do this — using a block element – page hero.
Thanks but are you saying that for the date to appear I need to do this for every individual post?
The issue is getting the "date/updated date" to appear on all posts and product pages.
I have followed this vid to a tee and as above - it runs along the top
https://docs.generatepress.com/article/block-element-page-hero/
https://menspleasures.com/wp-content/uploads/2021/08/gb-block-date.png
Do you know how to have dates positioned under H1 title or elsewhere or is it a case of going in manually to every post?
I would think post meta template - custom - after-entry_title might work but no joy from any of those settings so far apart from page hero - after header - after header.
Additionally I have tried this vid and nothing appearing which is why I thought the problem might relate to container margins.
Hi there,
I've inspected the page hero of the pages and I don't see any element rendered for the post date.
Any chance you can provide us temporary backend access to check the block element involved? You can use the private information text field to provide the details.
I disabled it as it doesn't look good.
Thanks Elvin, I've included info below.