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

  • Home
  • SEARCH
  • 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 768275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:09:25+00:00 2026-05-14T18:09:25+00:00

I have created a category template in WordPress for all posts that are in

  • 0

I have created a category template in WordPress for all posts that are in the ‘blog’ category. The file name is single-blog.php. There is some conditional code in single.php that checks whether the post is in the ‘blog’ category and if it is it redirects it to single-blog.php. That seems to be working fine.

The problem is that on all the individual ‘blog’ categorized posts the post title and content are echoed below the footer of the page. I do not know why they are showing up and I haven’t been able to stop it or hide it. The Loop is getting closed on the template page, but I’m wondering if the Loop from single.php is somehow also being sent over. You can view an example of the problem here:

http://69.20.59.228/2010/03/test-blog-post/

Please let me know if you have any suggestions. I am posting two sections of code below. The first is the conditional call in single.php. The second is the code from the single-blog.php (the category post template).

the conditional call in single.php.

<?php
$post = $wp_query->post;
if (in_category('blog')) {
include(TEMPLATEPATH.'/single-blog.php');
}?>

code from the single-blog.php (the category post template)

   <?php get_header(); ?>

   <?php get_sidebar(); ?>


   <p><h2>The IQNavigator Blog</h2></p>
   <em><a href="/category/blog">Blog Home</a></em> | <em><a href="/category/blog/feed/">Subscribe via RSS</a></em><p><br></br></p>

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>


    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
        <h1 class="pagetitle"><?php the_title(); ?></h1>
        <!-- <p class="details">Posted <?php the_time('l, F jS, Y') ?> at <?php the_time() ?></p> -->
        <div class="entry">
            <?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>

            <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
            <?php the_tags( '<p>Tags: ', ', ', '</p>'); ?>

            <p class="postmetadata alt">
                <small>
                    -----<br>
                    Posted
                    <?php /* This is commented, because it requires a little adjusting sometimes.
                        You'll need to download this plugin, and follow the instructions:
                        http://binarybonsai.com/wordpress/time-since/ */
                        /* $entry_datetime = abs(strtotime($post->post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */ ?>
                    on <?php the_time('l, F jS, Y') ?>, 
                    filed under <?php the_category(', ') ?>.
                    Follow any responses to this entry through the <?php post_comments_feed_link('RSS'); ?> feed.

                    <?php if ( comments_open() && pings_open() ) {
                        // Both Comments and Pings are open ?>
                        <a href="#respond">Leave your own comment</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.

                    <?php } elseif ( !comments_open() && pings_open() ) {
                        // Only Pings are Open ?>
                        Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.

                    <?php } elseif ( comments_open() && !pings_open() ) {
                        // Comments are open, Pings are not ?>
                        You can skip to the end and leave a response. Pinging is currently not allowed.

                    <?php } elseif ( !comments_open() && !pings_open() ) {
                        // Neither Comments, nor Pings are open ?>
                        Both comments and pings are currently closed.

                    <?php } edit_post_link('Edit this entry','','.'); ?>

                </small>
            </p>




            <?php the_tags( '<p>Tagged: ', ', ', '</p>'); ?>
        </div>

    </div>


<?php comments_template(); ?>

<?php endwhile; else: ?>

    <p>Sorry, no posts matched your criteria.</p>

<?php endif; ?>


<?php get_footer(); ?>
  • 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-05-14T18:09:26+00:00Added an answer on May 14, 2026 at 6:09 pm

    You could try adding exit()

     <?php get_footer(); exit(); ?>
    

    Is there code in your single.php file after the conditional? Includes do not stop execution and the interpreter will return to the single.php file after it is done with single-blog.php.

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

Sidebar

Ask A Question

Stats

  • Questions 373k
  • Answers 373k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can use this method with another parameter IplImage* cvLoadImage(const… May 14, 2026 at 7:30 pm
  • Editorial Team
    Editorial Team added an answer There isn't a single place where .framework folders/files are, they… May 14, 2026 at 7:30 pm
  • Editorial Team
    Editorial Team added an answer I think I've somewhere heard something along the lines of… May 14, 2026 at 7:30 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.