Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Calling Different Custom Post Timestamps in a table

OK so was way simpler than I thought in the end and didn’t involve a query of query.

The same can be achieved like this:

     /*GETING THE USERS FIRST PUBLISHED SUBSCRIPTION?? */
$useremail = $ticket['email'];
$user = get_user_by( 'email', $useremail );
$IDuser = $user->ID;
$args = array(
              'posts_per_page' => 1,
              'post_type' => 'subscription',
              'author' => $IDuser,
              'meta_key' => 'state',
              'meta_value' => 'complete',
              'orderby' => 'date',
              'order' => 'ASC',
              );
$first_post = new WP_Query($args);
//    '<pre>'.print_r($first_post).'</pre>'; // You can use this to check what the query produces to make sure you're on the right track.
if ($first_post->have_posts()) {
    $first_post->the_post();

    the_time('M j, Y');

    wp_reset_postdata();

Related Posts:

  1. WordPress plugin to publish to multiple remote WordPress blogs
  2. Human Time Diff, change mins to minutes
  3. What Can I Use To Add A Custom Button Between Publish button and Move To Trash?
  4. How can I create custom button in post.php
  5. Getting value from get_post_custom
  6. Customize rel=canonical tag for single blog post
  7. if in category but only with post meta
  8. How can I tell if a post has been published at least once?
  9. Simple Custom Metabox Not Saving
  10. How to bulk Update URLs to new values?
  11. Bulk Post update_post_meta
  12. Is there a action hook for the “Empty Trash” button?
  13. How to check if post meta key exists or not in wordpress database
  14. Remove Categories / Tags From Admin Menu
  15. add action only on post publish – not update
  16. How to display by default only published posts/pages in the admin area?
  17. How to add category to: ‘wp-admin/post-new.php’?
  18. How to prevent posts from being published too close to each other?
  19. Find out who deleted a page or post?
  20. Post/Page Preview Template
  21. Custom Post Types, slug, archive and SEO plugins
  22. How can I retrieve multiple get_post_meta values efficiently?
  23. Code to make a post sticky
  24. Setting Custom Sort Order of Posts within a Category
  25. Is it possible to Schedule Attachments in WordPress?
  26. Search Custom Post Type Pages and Custom Fields in 2 Dropdowns?
  27. How to allow hidden custom fields to be added from wp-admin/post.php?
  28. Where does WordPress store the users customization in the theme
  29. Add a checkbox to post screen that adds a class to the title
  30. Elegant way to include only published posts with get_objects_in_term()?
  31. Using single.php from plugin folder instead of default template folder
  32. using wp_update_post on save_post
  33. Custom permalink structure only for default posts
  34. Export WordPress Posts and Meta Information in CSV format
  35. Replace image attributes for lazyload plugin (data-src)
  36. Exclude drafts in all() view of edit.php
  37. Delete duplicated wp_postmeta record
  38. delete post also attachments
  39. Post publish only hook?
  40. Publish pending article from front end with a button?
  41. How to add a “publish” link to the quick actions
  42. How to limit user to publish post per day and per role?
  43. Is this the best (and only) option to style CSS for a given post type?
  44. Sort post by attributes ‘order’
  45. Will a large postmeta table slow a site down?
  46. Any way to create a revision of a post ONLY with a new button in the Meta Box?
  47. Update all posts automatically when using post_meta
  48. Attach pdf file to custom post type
  49. How to batch update post content with custom post meta value
  50. When a user creates a post (pending), send a confirmation link that allows them to publish
  51. Change slug with custom field
  52. How to display comments and comment form on custom post type?
  53. How to disable drafts?
  54. In what sequence are the hooks fired when a post is “published”?
  55. How to change the layout and styling of posts according to their category in WordPress?
  56. How do I create a featured post within a custom post type?
  57. Restrict the Number of Posts an Author can Publish (over time)?
  58. how to enable different number of revisions for different blogs when using WPMU?
  59. Add javascript when post is published
  60. adding a custom css class to post
  61. Prevent duplicate posts in wp_insert_post using custom fields
  62. Custom Post Type Pagination Doesn’t Work in WordPress 3.4
  63. Better post meta efficiency?
  64. Static posts page with home.php
  65. featuring old articles without messing up with the archive
  66. Add default content to post (for specific category)
  67. Unattaching images from a post
  68. Setting post meta data to random value during post status transition / on publish
  69. Pagination not working on Custom Page Template
  70. How to wrap every image in a post with a div?
  71. Post from front-end only by logged in users, form posts as “posted by:
  72. Edit meta data does’t work with custom sql
  73. Delete Post Link to delete post, its meta and attachments
  74. Publish posts only after the condition is met
  75. Navigation link to specific user page
  76. Hiding by default specific post status on backend list?
  77. Show One Category on Post
  78. WordPress Delete hook with wp_delete_post function?
  79. Custom post type single (permalink) throws a 404 error
  80. Order post by year DESC and month ASC
  81. How to edit wordpress RSS feed to show post title only
  82. Add custom field to category of custom post type
  83. Display custom post types by date field
  84. Change post format using custom field
  85. Detect Post Type when publish_post is ran
  86. How to hook a function only when I need to delete permanently a post?
  87. Allow role to delete posts but block him the wp-admin
  88. Does WP get all post_meta on POST page?
  89. Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
  90. How can I display a specific user’s first published post?
  91. Does WordPress remove draft status automatically?
  92. Sanitizing `wp_editor();` Values for Database, Edit, and Display
  93. Do I use custom post type or something else?
  94. Prevent post from being published if no category selected
  95. Exporting Data from WordPress into a flat table
  96. Send email to user that his post has been rejected
  97. how “manage_posts_custom_column” action hook relate to “manage_${post_type}_columns” filter hook?
  98. Adding Multiple Values to a Post Meta Key
  99. display order of connections
  100. Delete Post From Front-End and attachment permanently
Categories posts Tags customization, post-meta, posts, publish, timestamp
Shortcode default attributes over-riding non-default attributes
How to display taxonomy images with wp_list_categories?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress