enfold posts date not showing fix

Enfold Posts Date Not Showing (Advanced Layout Builder) – Fix

enfold posts date not showing fix

Enfold is an awesome theme that I used on many projects.   The only problem with Enfold is that an Advanced Layout Builder do not have some basic elements such as post tags, metadata etc.. all those elements are working perfectly fine if the page/post is created and published with Visual Editor.

Recently, I was working on my clients new blog and all blog posts were created with Advanced Visual Builder (not visual editor).  The first thing I noticed is that the date when the post is published is missing.  When I switched to Visual Editor, the date showed up, but of course all the content created with AVB was lost.

I started Googling and realized that Enfold have this issue since 2015 and believe it or not the theme authors still didn’t fixed it (!?)

Quick and Easy Solution

There a few solutions that could be applied but none of them are able to display the date above the content (because of Enfold hooks).

Open up functions.php file in your theme (or child theme) folder and add this code to the very bottom of the file and save it.

function post_date_shortcode(){
global $post;
return get_the_date('dS M Y', $post->ID);
}
add_shortcode( 'sc_post_date', 'post_date_shortcode' );

quick solution for enfold date

The code above generates a date shortcode that you can add to your posts or pages.   In order to automatically display this shortcode on all the posts and avoid further coding, download and install this plugin:  Insert Blocks Before or After Posts Content

After you activate this plugin, go to Appearance > Before/after content > Create a new block and in the content area simply add this shortcode and publish the block:   [sc_post_date]

Now go back to Appearance > Before/after content and on the top in Post section

 

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *