This worked for me. I created variables for both the month of the post and the year of the post.
<?php
$post_month = get_the_time('F');
$post_year = get_the_time('Y');
if ( is_page('about/mission-statement/')) {
echo '<time>' . $post_month . ' ' . $post_year . ':' . '</time>';
}
?>
Related Posts:
- wrong php date()?
- Get date numerical and separate?
- Print last modified date only on posts
- Find hours between post_date and post_date_gmt
- How do I check or test a WordPress Auto Year Change Script?
- Get date function not working
- Display Year and Month from custom field + Age Calculator
- Need help setting default setting value for radio button in theme customizer
- How to automatically apply woocommerce product title to all product images alt tags?
- How to store the_title() into a variable to reutrn the value, not just echo it
- exclude multiple terms using get_terms() function
- Create a global variable for use in all templates
- Should the value of core functions be escaped before outputting?
- Why is my custom meta box input not saving
- Dynamic URL to reference custom PHP files
- WooCommerce – Customer Order History Pagination
- Change dns-prefetch to preconnect with correct protocol
- The values of custom fields are not available functions.php
- display most popular tags in two columns
- How to make thumbnail image fit into a div where image dimentions are completely different?
- Add before_content and after_content to register_sidebar
- How to access function from outside of a class within this class in WP plugin?
- Word Count Function Preventing Permalink Editing
- PHP can I add line numbers to file_get_contents()
- Using file_get_contents with Gravity Forms uploads folder to create images in the media library returning false
- Replace word in “the_content” only for index.php
- Custom location for attached images
- Remove meta description on certain pages
- Image media upload metabox
- How to combine wordpress_logged_in cookies in one cookie?
- Two Different Links for Same Product – WooCommerce [closed]
- Woocommerce related product text
- esc_html_e() is not translating string in wordpress [closed]
- Pass php dynamic variable to shortcode
- Limit 1 global comment per minute
- Modify custom field input data before creating a new post
- Query Pages and post excerpts dynamically
- Is there a way to conditionally check whether a WordPress post title is empty?
- Echo a function inside a function
- Use WordPress function in php file
- Get my site session in wordpress?
- wp_force_remove_style’ not found
- is_user_logged_in() not working in AJAX validation call
- Register a menu – Error Header
- Pagination on Custom Post
- how to save checkbox data for custom setting?
- How to keep the capability of users and disable Gutenberg editor in WordPress?
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- How to create a field in customize and show that in header.php?
- Set site title & tagline with wp.config or function.php
- Shortcode to embed Edit Account form not working
- How to make jquery count down timer function manually editable
- Enqueing External JS on the remote server JS
- iframe not showing in content on blog page
- Get user custom field value on function.php
- Get the name of menu item with wp_nav_menu
- How to add aria role and schema markup to custom walker container
- PHP Output also in Child theme, but different
- Dynamically Generate Functions and Hooks
- Remove submenu item from list
- Strip from or something better?
- Customize field names in backend profile edit page through function.php [duplicate]
- Time Delay a URL Redirect for Specific Page
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Need help for some PHP code
- Adding HTML Code to Replace Text in PHP
- how to replace h1 entry title with h2 in category pages only
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- Wp_Schedule_Event every few minutes doesn’t work
- File from parent theme imported to child theme doesn’t work – any ideas?
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- register_block_type is not working properly
- PHP “warning include_once(): Failed to open stream” Simple HTML DOM in WordPress Child Theme
- cURL needing to loop through all “next_page”
- Woocommerce – if selected attribute term equals
- split 1 cart item into instock and back ordered
- post_exists stops working in a scheduled event
- How to center all text body in single.php at once?
- Access WP files on “server 1”, from “server 2” – using wp-load on an external website
- How can I get my pagination loop to display the correct number of total pages?
- Get posts by id using shortcode
- Is it possible to replace ‘attachment’ with another word?
- How to include a function in a template with template tag
- wordpress all post filter by year
- Show post/page into div using function
- PHP get_category() function redeclared
- How to trim content AND retain HTML?
- Display posts using post ID’s in an array
- Pulling a variable into the wp_nav_menu function
- Popular Post Not Show
- wp_delete_comment is doing nothing
- WordPress – registering sidebar and adding a button directly after .textwidget
- WordPress adding in site URL to header links
- Adding code to the function file
- Error on Include php:/usr/share/pear
- I am trying to replace a string with other from function.php
- Problem with function.php.. like
- Echo get_option displays as text
- Need help with Deprecated: Non-static error when update PHP 7.4 -> 8.1 with Dyad 2 theme
- posts_clauses drop ACF get_field function