- What is Astra Pro Add on?
- What Is a Child Theme and How To Install It for Astra?
- How to Activate Astra Pro Addon License?
- How to Get License Key of Astra Pro?
- How to Install Astra Pro Plugin?
- Getting Started with Astra Pro Addon Plugin
- Getting error – The package could not be installed. The theme is missing the style.css stylesheet?
- Do Not See License Activation Form for Astra Pro Addon Plugin?
- How to Install Astra Theme?
- Astra – Customize the Submenu
- The Blank Screen in the Customizer Area
- How to use the color palette of the Astra theme
- How to Import / Export Astra Customizer Settings
- How To Disable Logo Cropping
- How to Create a Sticky Sidebar for Your WooCommerce Shop Page
- How to use dynamic customizer from Astra 4.0.0
- How to Change the Typography of the Astra Menu
- Simplify Your Site Design with the New Style Guide
- How to Translate Astra Theme / Plugins in Your Own Language using GlotPress?
- How to Turn Astra Multilingual with WPML?
- How To Translate Site Builder With WPML?
- How to Translate Astra Strings with WPML?
- How Translations can be Manually Exported and Uploaded to the Site?
- How to Turn Astra Website Multilingual with Polylang?
- How to Translate Categories, Tags, and Astra Strings with Polylang
- How to Turn Astra Website Multilingual with TranslatePress?
- How to translate the WooCommerce string?
- Footer Custom Text Helper Strings
- Does Astra support Beaver Themer Plugin?
- Increasing the PHP Memory Limit of Your Website
- How to Disable Header or Footer for a Landing Page or Post?
- Where Does Astra Primary Color Setting Take Effect?
- How to Adjust the Width of Your Sidebar?
- How to Update the Plugin Manually from WordPress Backend?
- Recommended Settings for Elementor and the Astra Theme
- Recommended Settings for Beaver Builder and the Astra Theme
- How Do License Upgrades Work?
- How to Renew Yearly License?
- How to Apply For Brainstorm Force Affiliate Program? (Become Astra Affiliate)
- How to Manage License on Store?
- How To Update Your Payment Method?
- How do I check my Support Ticket History?
- Frequently Asked Questions – VIP Priority Support
- How to Process Refund Requests?
- Fix Swap Sections Not Working on Mobile (Old Astra Header)
- How to Remove Google Fonts Suggestions in Astra Theme?
- Remove default stretched block layout spacing
- How to Change the Logo on Specific Pages?
- How to remove horizontal & vertical gallery layouts from a single product page?
- Introducing New Filter to Enable/Disable Rank-Math Theme Support
- Enable/Disable YouTube videos from Astra admin dashboard
- How to Fix the Line Height Unit being converted to “EM”?
- How to Change WordPress Post labels to Projects
- Fix for – The PCLZIP_ERR_BAD_FORMAT (-10) Error
- Fix for – Parse error: syntax error, unexpected T_FUNCTION
- How to fix Fatal Error / White Screen of Death?
- Fix for- cURL error 51: SSL: no alternative certificate subject name matches target host name ‘websitedemos.net’
- Getting error – The package could not be installed. The theme is missing the style.css stylesheet?
- ‘The preview could not be loaded’ Pop Up with Astra and Elementor
- Troubleshooting Steps ( with Health Check & Troubleshooting plugin )
- How to Deal with Update Issues in Astra Theme and Astra Pro Addon?
- Blog Featured Image Size Not Working / Error in Image Processing Library
Display Published and Last Updated Dates on Blog Posts
Astra provides an option to display the published or last updated dates on the blog meta. You can control this from the customizer and choose to display either. You can check this doc to see how it works.
Sometimes, there is a requirement to display both published and last updated dates on the blog posts by providing a clear view of when the post was published and updated.
In this guide, we will walk you through the process of displaying both published and last updated dates on the blog posts, for both Blog Archive and Single Posts.
Display Published and Last Updated Dates on the Entire Blog
To implement both published and last updated dates on the entire blog including the blog/archive pages (i.e., main blog page, category, or tags) and single posts, you can add the following code to your website.
function your_prefix_post_date2( $output ) {
$format = apply_filters( 'astra_post_date_format', '' );
$modified_date = esc_html( get_the_modified_date( $format ) );
$modified_on = sprintf(
esc_html( '%s' ),
$modified_date
);
$updated_output = '';
$separator = ' /';
$separator = apply_filters( 'astra_post_meta_separator', $separator );
$published_string = __('Published : ' , 'astra');
$updated_string = __('' . $separator . ' Last updated : ' , 'astra' );
$updated_output .= '';
$updated_output .= ' ' . $modified_on . '';
$updated_output .= '';
$modified_output = $published_string . $output . $updated_string . $updated_output;
return $modified_output;
}
add_filter( 'astra_post_date', 'your_prefix_post_date2' );
The above code will display both published and last updated dates on the blog pages. By default, it works for both archive and single posts. You can modify it according to your requirements and add it to the functions.php file of the child theme.
If you don’t have your Child Theme installed, please check this article on how to do it. If you are not sure how to add this code, please check this article.
Display Published and Last Updated Dates on Single Posts or Blog/Archives
The above code, if added directly to the child theme, enables both published and last updated dates on both the blog/archive and the single posts.
But, if you wish to display it only on the single posts or only on the blog/archive pages, you can use the below approach:
1. First, enable the Site Builder module of Astra Pro
2. In the Site Builder, create a hook layout and switch to the code editor

3. In the code editor, add the above code within the PHP code syntax as instructed below:
<?php
// Add the code here
?>
4. Now, select the layout as Hooks and Action as WP_Head

5. Once the layout and actions are selected, it is time to apply the correct display conditions. The display conditions will allow you to display both the published and last updated dates on the blog/archive page or single posts.
To display the published and last updated dates only the single posts, select all posts.

After making the above changes, publish the layout and check the front.
Using the Site Builder module, you can also create a custom template for the single posts and modify the entire layout and content according to your requirements. You may check this doc to see how it works.
Now, when you see your blog posts, the post meta will include both the last updated and published dates as shown in the below screenshot:

To display it only on the blog/archive pages, simply change the display conditions in the Site Builder layout.
We hope this document has been helpful. If you have any questions, feel free to leave a comment below.
We don't respond to the article feedback, we use it to improve our support content.