WP-Query different on various pages [Problem]
-
<?php
$my_query = new WP_Query(‘category_name=featured&showposts=1’);
if (have_posts()) : while (have_posts()) : the_post();
update_post_caches($posts);
$name = the_title(”,”,false);
$name = ShortenText($name);
?>- ” title=”<?php the_title(); ?>”><?php echo $name; ?>
<?php endwhile; endif; ?>
I use that script to grab all the post titles and links in the featured category, then put them in a list. It works fine on index.php – but when it’s on any other page – it just grabs all the pages from the current category, or the current page etc.
Anyway to make it so it works on every page?
Thank you,
Sam.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘WP-Query different on various pages [Problem]’ is closed to new replies.