Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8867591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:04:59+00:00 2026-06-14T17:04:59+00:00

just wondering can anyone see anything wrong with this code. It worked perfectly on

  • 0

just wondering can anyone see anything wrong with this code. It worked perfectly on the development version, and this is an exact copy.

I thought it may have been something within the loop but I even tried echo 'hello'; straight after the if ( have_posts () ) : and nothing appeared, yet I did the same immediately before the if and it appeared.

Here is the overall code….

if ( have_posts() ) : 
            $the_query = new WP_Query( array ( 'posts_per_page' => 1, 'p' => 4998 ) ); /*  */
             while ($the_query->have_posts() ) : $the_query->the_post(); 
              the_content();
             endwhile;
                wp_reset_postdata();

                endif; 

            ?> 

Thanks for any help.

EDIT : Apologies if my problem sounded vague, basically whats not working is that nothing at all is appearing even though the post ID is correct and there is no other issues regarding css etc as to why it wouldnt appear. And even after trying to just display a word like “hello” after the if , still nothing.
Im just confused as to why this would stop working all of a sudden.
Thanks again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:05:01+00:00Added an answer on June 14, 2026 at 5:05 pm

    Yep I checked. Use have_posts() on the query you create (create query outside if)

    http://codex.wordpress.org/Class_Reference/WP_Query

    As a global call, have_posts() checks if the page, if configured the right way, has posts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just wondering if anyone can optimize this usortMonths() function to be better? Basically I
Quick question, just wondering if anyone can see where the syntax error is in
Just wondering if anyone has any ideas on how we can style templates... Like
i m just wondering if we can do this with preg replace like if
Wondering if anyone can help with this. I have a table with some fixed
Just wondering if anyone can recommend a good loading HUD for a SPA based
I've hit this a few time and was just wondering if anyone might know
Wondering if anyone can help me with this slight problem i'm having. I am
Just wondering how I can make my app open automatically at login, but make
Just wondering how I can paste an object after I have selected it in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.