2 deleted 115 characters in body
source | link

That happens because you're not handling the 'no-posts' condition in your loop. I handle it in my themes as follows. Try using this code:

<?php if (!have_posts()): ?>
    <article id="post-0">
        <header>
            <h3>No posts found.</h3>
        </header> <!-- end article header -->

        <section class="post_content">
           Sorry, we found 0 posts for your search, Please try searching again.
        </section> <!-- end article section -->

        <footer>
        </footer> <!-- end article footer -->

    </article> <!-- end article -->
<?php endif; ?>

It's like an else for your if(have_posts()), we'reWe're handling the if(!have_posts()) condition. Put it right after your h3.archive title, before if(have_posts) starts. You can even call the search form function in the content area.

That happens because you're not handling the 'no-posts' condition in your loop. I handle it in my themes as follows. Try using this code:

<?php if (!have_posts()): ?>
    <article id="post-0">
        <header>
            <h3>No posts found.</h3>
        </header> <!-- end article header -->

        <section class="post_content">
           Sorry, we found 0 posts for your search, Please try searching again.
        </section> <!-- end article section -->

        <footer>
        </footer> <!-- end article footer -->

    </article> <!-- end article -->
<?php endif; ?>

It's like an else for your if(have_posts()), we're handling the if(!have_posts()). Put it right after your h3.archive title, before if(have_posts) starts. You can even call the search form function in the content area.

I handle it in my themes as follows. Try using this code:

<?php if (!have_posts()): ?>
    <article id="post-0">
        <header>
            <h3>No posts found.</h3>
        </header> <!-- end article header -->

        <section class="post_content">
           Sorry, we found 0 posts for your search, Please try searching again.
        </section> <!-- end article section -->

        <footer>
        </footer> <!-- end article footer -->

    </article> <!-- end article -->
<?php endif; ?>

We're handling the if(!have_posts()) condition. Put it right after your h3.archive title, before if(have_posts) starts. You can even call the search form function in the content area.

1
source | link

That happens because you're not handling the 'no-posts' condition in your loop. I handle it in my themes as follows. Try using this code:

<?php if (!have_posts()): ?>
    <article id="post-0">
        <header>
            <h3>No posts found.</h3>
        </header> <!-- end article header -->

        <section class="post_content">
           Sorry, we found 0 posts for your search, Please try searching again.
        </section> <!-- end article section -->

        <footer>
        </footer> <!-- end article footer -->

    </article> <!-- end article -->
<?php endif; ?>

It's like an else for your if(have_posts()), we're handling the if(!have_posts()). Put it right after your h3.archive title, before if(have_posts) starts. You can even call the search form function in the content area.

    Post Made Community Wiki by Rutwick Gangurde