I think the answer is:
when you’r in single page/post/cpt view ( you’r checking it with is_single()
) you always should have $wp_query->post_count
equal 1, but if it is future post/page/cpt than it will result to 0 ( becouse there are function/actions applyed to check if it is future post )
and $posts = $wpdb->get_results($wp_query->request);
that how you’r telling not to apply these functions/actions wich checks for future posts/pages/cpt
Related Posts:
- Is it possible to use a single custom post as the site front page
- Listing a post’s categories and subcategories
- Single post comment template not working
- How do I show google ads between post content?
- Add inline style to get_the_category_list
- Disable single view for specific post category
- Only nextpagelink on wp_link_pages
- Display a post map on a blank/new page
- How To Pass Current Post Type ID from Single Template To Custom Page Template
- Is it possible to create rel=”noindex, nofollow” for a single post if contain bad keywords?
- Custom seperate Single.php
- Set a cookie only in single posts
- Custom post type not respecting template hierarchy
- diffrent style for post single page
- WordPress object for comments frame [closed]
- I’m having a problem viewing the Youtube video
- Use different «Single.php» for custom categories
- force https except one page/post
- Single custom post type template not working (single-custom_post_template.php) not working
- Single.php category entries not showing right colours
- Link from archive-page.php to single-page.php
- How to check if a post is in categories x,y,z inludint their subcategories
- Changing the display of the themename_posted_on() function
- How to Highlight current category on category and single page template?
- Exclude single page from function
- WordPress, alternative single post template
- get full real path of thumbnail post img wordpress
- how to loop through this in blog single?
- Modify post template on Divi Theme
- I want to signin from first wordpress site to other wordpress website without registration..without using network mode
- Try to showing product file size on product single page
- Improve related posts
- Get active term on single (CPT) page
- Having single posts appear under the blog homepage and highlight menu items properly?
- Single.php loading fully on localhost but not on server
- explain why is_single doesn’t work
- Custom post type single page returns 404 error
- A special single page templates for posts under a category and all its child category
- single page wordpress
- HTML code in Custom field
- How to have different content in the loop and single
- Single.php Active Category Class
- Possible to paginate on single.php?
- get_terms parent for current product only
- single page site with subpages
- Get_the_author doesn’t return author name
- Disable single post page
- Archive page for custom post type not working
- how to know if the post has pagination () or not
- How to disable single post view in wp
- Custom Post Templates
- How to check the terms in single custom post type template
- How to show the archive / post type description on Single templates
- Posts of custom post type load the page template
- Add caption functionality to custom WordPress theme
- I want to extend the current themes’ single.php to display the meta fields of my CPT
- Using loop pagination on single.php
- Custom post type not displaying content from single-{custom post type} page
- get_adjacent_post – in same term or category not working
- Issue with loading mobile specific custom single page layout in mobile
- Issue on single.php pagination WordPress
- Adding range to wp_link_pages()
- Single.php – Get Current Parent Category
- single-{post_type}.php not working
- Is_single() conditional tag returns null in query
- Single.php different behaviour from admin to non-admin
- Associate page w/ specific single post template?
- browser showing connection was reset while accessing posts from local host
- Multiple comment forms on a single page
- Creating php pages in wordpress and assigning them to wordpress pages
- Simple way to style posts of a single category differently in the loop and in single
- How to use apply_filters?
- Redirect after post deleted
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- Attachment image single page
- Nest Next and Previous in a href with class that has a background image
- Conditional single.php statement not recognizing conditionals
- How can I include ALL post types in the_post_navigation() links, not just current post type?
- Limit the number of characters/words in an excerpt for a related posts section
- Two different single.php depending on source page
- Shortcode and get_template_part
- How to display different blocks for mobile and desktops
- two col layout bootstrap 4 with one fixed col and fade in effect on image
- Post Template Query with WP_Query?
- How to make “single post” permalink maintain it’s sub-page structure
- customize src attribute in woocommerce single product image
- How to use a capture from a rewrite rule inside a php file (like single.php)?
- Custom Single Template
- How to set class to “current-page” on the currently viewed single post within a CPT
- List posts of assigned categories in list of all categories on single.php
- WordPress not using edited image
- how to change single post link
- Is possible to do this from function.php
- How to display category wise posts on seprarate template
- Pulling in Related Posts based on Post Type array
- Page Templates Used in Custom Post Type
- how to load custom single.php?
- Insert Shortcode exactly at the end of the content
- WordPress More tag doesn’t work on Single post
- Show Next/Previous without Link