Support » Plugins and Hacks » Hacks » query_posts() from a particular category overriding Page title

  • Okay so I had been trying to display posts from a particular category at home page using query_posts() functions at the home page at freespywaredeleter.net.

    However seems like calling this function is overriding the Page title.
    It displays the category title instead of what is set as Homepage title.

    The code used is:

    <?php query_posts('cat=5&showposts=5'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
      <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
        </li>
    <?php endwhile; endif; ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • sparklogix

    (@mybenson)

    I’m having this exact same problem. Not even the All-In-One-SEO plugin will override the title. Anyone know a fix for this?

    esmi

    (@esmi)

    Forum Moderator

    Don’t use query_posts. Use get_posts or WP_Query.

    sparklogix

    (@mybenson)

    Thanks 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘query_posts() from a particular category overriding Page title’ is closed to new replies.