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 change post date and post time in WordPress automatically with a function
- Date not working correctly
- Calculate business days
- How to get WordPress Time Zone setting?
- How to set and use global variables? Or why not to use them at all
- the_date() not working
- How to deprecate a function used in a plugin?
- Converting timestamps to local time with date_l18n()
- How to manually fix the WordPress gallery code using PHP in functions.php?
- How to make a image-size selected by default in Media upload – WP v3.5
- What is This esc_html_e() i wordpress php?
- Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]
- How to Add Image to WordPress RSS-Feed with no Plug-in?
- Function to return true if current page has child pages
- How do I change/modify the_post_thumbnail(); html output?
- Mega Menu Walker
- start_lvl Ignored in Custom walker_nav_menu
- Enforcing password complexity
- PHP code in page template vs functions
- Apply class to every paragraph that holds image?
- Remove “Insert from URL” link in Media upload – WP 3.5
- static variable loop not working in WordPress
- Cleaning up WordPress to improve performance?
- Displaying Logged-In User Name in WordPress Menu
- Hide main div if wp_nav_menu is empty
- Proper use of Output Buffer
- List of all theme customizer control types?
- Autoloading in Child Theme
- Does My Child-Theme Functions.php Need if{die} Security In It? [duplicate]
- Modify previous and next text from pagination links
- Allowed memory size of 268435456 bytes exhausted (tried to allocate 7146491840906359738 bytes)
- How to add a class to the attachment images
- Need help setting default setting value for radio button in theme customizer
- How to call a function only once (global variable scope)
- Multiple is_page() in page.php
- Should I write a PHP function in home.php?
- Removing Default Gutenberg Blocks, But Keeping Reusable Block Functionality?
- Edit tag cloud widget number
- adding a filter to a shortcode?
- username_exists() function can’t be access without logging in
- Customize default settings on new sites on multisite
- Set media upload attachment link to none and hide it in WP v3.5
- How can I modify the permalink via a filter?
- How to draw media details for Isotope gallery using Photoswipe
- How to call a PHP function from Javascript in WordPress
- 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
- PHP function showing wrong time in WordPress
- Is it possible to disable a function of a parent theme?
- Add Useragent to the body class?
- How do I make my function add variables/values to the $post object?
- Hide old attachments from wp media library
- How to override an unpluggable parent theme function?
- PHP – redirect https to http and www to non-www
- function_exists call in function.php
- How to register images uploaded via FTP in media library?
- Fatal error: Call to undefined function plugin_dir_path()
- Switching wp_get_sites to get_sites
- Check if a menu is empty?
- wp_set_object_terms and arrays
- WordPress Infinite Scroll without using any plugin
- Build a content and excerpt grid loop with paging and options for # of posts
- Shortcode putting html such as
- How to preserve PHP modifications while upgrading WordPress?
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- Debugging an error: wp_enqueue_style was called incorrectly
- How to log out everywhere else, destroy all sessions “all other devices”?
- how to get permalink structure with php
- Inserting Gravity Form checkbox values into Advanced Custom Fields [closed]
- Change the footer text on the login page
- How to remove a metabox from menu editor page?
- How do I remove a require_once admin panel from the parent theme from the child theme functions.php?
- Should the value of core functions be escaped before outputting?
- How to get the registered sidebar’s name by its id?
- Remove wp-mediaelement.css from wp_head
- How do I get the author’s page url from their ID?
- Why is my custom meta box input not saving
- add_filter to post-gallery and remove all ‘s?
- How to get year, month and hour in WordPress?
- Dynamic URL to reference custom PHP files
- How to correct schedule my event weekly with wp_schedule_event()
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’