All the date functions reference the global $post
variable, but from your code the $post
variable is not being used, so that’s why the date is wrong.
Try this (untested):
foreach ( $total_results as $tr ) {
echo get_the_time( 'j F Y, G:i', $tr );
}
Related Posts:
- A search for ‘0’ returns results
- Get date of last update outside of loop
- If No Search Results, Show Posts from Alternate Search Query
- Custom search form to display users only
- How to get an array of years from all of the search results, and use it to filter by year the paginated loop?
- How to go about combining dropdowns / filter queries?
- Get search.php results in header.php?
- Trouble Formatting DateTime
- Filter the_posts doesn’t work on search page
- How to modify search.php to not show pages only show posts
- Include future posts in tags and in search
- Search page loop banner image issue
- Does search.php autofilter The Loop?
- How do I set the Stewart Search Template to return only published posts in the result
- Trying to get all links in my posts
- Work arounds for conditional checks inside the loop in search.php?
- Search – Check if post is a page on search page
- Eliminate duplicates in a foreach loop [closed]
- Can I force WP_Query to return no results?
- How do I get the attributes of a short code from a post?
- Show scheduled posts in archive page
- post__in – Placing content from a foreach loop inside of an array
- loop query exclude meta_key with meta_value
- “Blog pages show at most” in The Loop
- wp_insert_posts Fatal error: Maximum function nesting level of ‘100’ reached, aborting!
- Post Loop not Returning Permalink
- Get posts that matches specific terms of multiple custom taxonomies
- add_filter() doesn’t work in loop
- The Loop in Static Page
- Content/Excerpt length control for a specific loop?
- Why we use if with while loop?
- Loop posts only excluding first post
- Loop repeating design pattern
- Customize WooCommerce Product Images (Placement and size) [closed]
- Create a loop that gets pages with their template
- Why is my loop not dynamically grabbing the correct Category and displaying all categorized posts?
- How to check if a post exist?
- Query posts if meta key starts with
- 3 Posts in Loop, Show Stickies First
- Loop within a loop (Again) for template
- Why cant you place the Loop outside of the index.php?
- sticky post in custom loop
- Rating system and changing the loop
- Ajax Button to load more Posts into a timeline
- On single.php, fetch 2 posts created after and 2 posts created before in relation to the actual post (using menu_order)
- Problem getting current post tags to show in a widget
- Post classes in the loop are being changed in certain themes
- Exclude page name from loop
- PHP if post is already displayed, then
- How to style first post differently with ‘get_template_part’?
- Include multiple page ids in loop
- in Foreach Loop the Description is not showing?
- 404 Template customization | Want 10 recent Post on the 404.php error page apart from the error Notice
- How to append a query string to pagination?
- For each loop on every word in post
- Display name of taxonomy once
- Use have_comments() for current post instead of last post in loop
- Displaying the first, second, and third posts from a category in separate slides
- Sending mail not working correctly
- WordPress shortcode in content, output in sidebar?
- Using variable in WordPress loop as criteria
- WordPress Alphabetical Sort Loop Issue
- Get_template_part() problem with the_content()
- Why doesn’t ‘continue’ work in page?
- Fetching posts from wordpress function in ajax
- Saving return value from the_author_posts_link()
- how to run loop in function.php that sends email based on specific conditions?
- How to use this $tax_selection variable in this custom loop?
- How to sort a loop after most viewed
- WordPress posts loop not displaying all posts on blog
- get_page_by_title not working inside fucntions.php
- Bootstrap tabs are not being clicked in WordPress loop
- Get gallery in loop through ajax
- Get a specific size from wp_get_attachment_image_src
- Get top Page IDs from menu and cycle through their child pages on a scroller
- Show other category posts in single.php
- Why does it loop twice?
- Custom Looping of WordPress Posts
- how to place Post and page content side by side
- Add specific class to featured posts
- Echo Most Recent Sticky Post in Loop?
- Custom search (wp query by custom fields)
- ACF field not appearing correctly in loop
- Posts are being displayed from old to new, in ascending order
- Loop in taxonomy for terms and post
- WordPress Tags in class
- Display articles related to a custom field on a page
- The Loop isn’t working
- Changing the loop w/o killing category links
- Custom loop page with post navigation
- Pages with a loop (index, archive) are loading the first image as post_thumbnail
- the loop – how to control whether wp or plug-in runs it
- stuck with template hierarchy
- Modify my code – which takes the first sentence of the post and use it as a h2 tag – to work outside the loop
- How to show only specific tag in wordpress loop
- Different style for first two (sticky) posts
- WooCommerce – Checkout suddenly stops working [closed]
- Want to images load first then title in WordPress loop
- How to add a continuous number to HTML tag attribute value inside The Loop [closed]
- WordPress Not Sorting By Custom Field