You have to pass the second parameter $post
to get_the_time('j')
:
get_the_time( 'j', $post );
If you don’t WordPress will just use whatever the current global post object is.
Related Posts:
- Get date numerical and separate?
- Print last modified date only on posts
- Display Year and Month from custom field + Age Calculator
- WordPress returns a wrong date
- Unable to set right time in admin and frontend template
- wrong php date()?
- display month in french in wordpress/php?
- Displaying the Month and Year that a page was Created?
- Find hours between post_date and post_date_gmt
- How to get User Time Zone in WordPress?
- How do I check or test a WordPress Auto Year Change Script?
- If Post Published Date or Modified Date is 1 Year or Older, Display Notice on Post Page
- WordPress wrong dates bug
- Can’t add to time? [closed]
- Adding a number to a date
- Convert custom field date format to “WordPress default”
- How to Add Image to WordPress RSS-Feed with no Plug-in?
- WordPress Infinite Scroll without using any plugin
- How to remove a metabox from menu editor page?
- How to add active class to custom menu using while loop and wp_list_pages
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- WooCommerce – Display variation custom field value [closed]
- New Plugin Review
- Problems with function on function.php
- Woocommerce HTML email option unavailable
- Use template for posts with a particular category grandparent
- How to add SVG icon above product tab title
- is_page “range” for if statement?
- WordPress child theme fails to override parent navigation menu in /inc/structure/header.php
- jQuery not defined
- Converting HTML Template to WordPress Theme
- WordPress add post format support not working
- How can I apply_filters from inside a function?
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Populate editor with some content of a page with a page template
- I want to load in a new class but only if the current page is single-movies.php
- Skt full width basic slideshow problem
- $wpdb->wp_users returning empty value for
- php syntax : [ && ] between commands [closed]
- Which PHP page is the Default Posts Page
- Converting Y-m-d to a date with a Month name? [closed]
- Need to put a script above tag in header.php – WP 5.7.1
- How to create an ACF shortcode with Repeater Field in WordPress? [duplicate]
- How to show/hide php table rows based on the content of custom fields
- How to call multiple functions from multiple files into a WordPress page template [closed]
- Prev/Next Links Broken on Static Front Page Pagination
- Isotope Drop Down Categories Filter Function
- How to use array in function to get only value I want
- What is the best way to define constant options for a theme?
- How to add no follow to specific links?
- add_filter function concatenate string and locate_template function
- Function for simple math doesn’t work what am I doing wrong? [closed]
- How to return a string that has a jQuery and Ajax inside in a shortcode?
- How do i wrap woocomerce attribute in list?
- Removing files programmatically
- get_page_templates only return templates with “home” in the filename
- Class property seems to lose scope, attached to save_post action?
- Nav-Menu not showing up
- Show different website layout if no sidebar added
- get_template_part function and add images
- Need advice on theme customizer and child themes
- How to make sure relative URL works when site is not on root domain?
- How to pass hook variable to function?
- exclude custom post type from running a function
- Migrating site, only header shows
- Execute PHP code only with specific user role
- WP Container Displaying Only on First Page of Archive
- Woocommerce – Exclude variation attribute on specific variation
- PHP function for horizontal Woocommerce thumbnails and badges
- Add Pre-Defined Value to Click Counter in WordPress
- Creating a Function and Call It
- WooCommerce display price before add to cart [closed]
- Show sidebar only to author of post
- No more get_option(‘date_time’) in WordPress 5.5?
- How to move a post from one category to another
- Show data obtained from a function and place it in a shortocode function
- how to add custom select field to wordpress edit page
- How to override theme’s public static function inside of a trait?
- Delete empty title_tags, find a h1 heading and echo it
- Get posts from year from URL
- how to use 2 index.php file One for mobile and one for desktop
- WP_Query To Display Product Of Brand On Taxonomy Page
- How can I export data without using any import/export plugin
- Search for images that width and height is more than 500
- Matching multi user
- Add disclaimer before certain posts and pages
- auto metakey value on post tile
- How do I routinely extract the thumbnail of the most recent post?
- wordpress ajax return 0
- Modify category archive page loop on functions.php
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Check if values exists DB
- Overwriting a Shortcode
- Search box background on a different page template
- WP Ecommerce: Display the “Order Notes” as column in the Sales Log [closed]
- A next page function with shortcode?
- What is the wrong with this function to enqueue the scripts and styles to the theme? [closed]
- a problem in class in class-wp-hook.php
- change title of page dynamically
- Custom plugin doesn’t show in admin menu – when code added, displays an empty page