• This code displays a snippet of a news item, but only seems to work on the Home Page sadly:

    <?php query_posts('showposts=1&cat=1'); ?><?php while (have_posts()) : the_post(); ?>
    					<li><p><?php the_content_rss('', TRUE, '', 10); ?></p></li><?php endwhile;?>

    Why would it not work on any other page? I’m sure it must be something simple.

    Thanks for your help

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter sincewelastspoke

    (@sincewelastspoke)

    Does anyone know why the above code only works on my home page.

    Thanks for looking ??

    That code should work everywhere equally. Are you sure there isn’t a conditional tag like is_home() anywhere else on the page, tho?

    Thread Starter sincewelastspoke

    (@sincewelastspoke)

    There was one originally for including a sifr.js link, but it’s out now.

    It makes no sense at all.

    I’m looking at the output source code and comparing the ‘Home Page’ with one of the other pages, and there’s no difference really.

    Thread Starter sincewelastspoke

    (@sincewelastspoke)

    Can anyone else help with this?

    The script above is stored in an include file, which is included in ALL pages, just to make it easier to modify across the whole site.

    It displays the news item on the home page, but nowhere else.
    Can’t think at all why this could be happening.

    Does this part look for the RSS feed in my HEAD code? <?php the_content_rss('', TRUE, '', 10); ?>

    Any advice would be great.

    Thread Starter sincewelastspoke

    (@sincewelastspoke)

    Update
    It seems to only work when I’m in an ‘archive.php'(like the category(?cat=4)) or the home page itself. Every other page it doesn’t want to work for me ??

    Can anyone assist?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Code only works on Home Page?’ is closed to new replies.