Support » Fixing WordPress » Feeds and Displaying them

  • Resolved Cregy


    Hi Guys

    I don’t even know what to look for so I hope someone can point me in the right direction please!

    On the above site I have two wp installations for designers and tips. What I would like to do is to take a feed from the tips area. I would like to take the categories feed and use it for the front page and also randomly select a tip and place in a box. A sort of teaser type thing.

    Can anybody tell me how I might do this please?



Viewing 9 replies - 1 through 9 (of 9 total)
  • Actually, it sounds like you might do better learning how to use the Loop for what you want to do.

    The Loop is what WordPress uses to display posts, and you can read about it on the codex:

    You can use it on any PHP page you like, it doesn’t have to be a WordPress page.


    I have read the loop pages and I am a little bit confused. How do I get the loop to display categories from a different directory please?

    I have the main front page as root and then tips as /tips/ and designers as /designers/! If I want to pull a list of categories from tips how do I tell the loop to go to the tips directory to get the list of categories please?

    Is it something to do with either of these please:
    <?php define(‘WP_USE_THEMES’, false); get_header(); ?>
    <?php wp_head(); ?>



    Just before starting the loop you would put an include for the relevant wp-blog-header.php file. That way you link to correct wordpress installation.


    I have ended up with something like this:
    ‘<?php require(‘’); ?>’

      ‘<?php wp_list_cats(‘sort_column=name&optioncount=1′); ?>’

    but it doesn’t work!

    Any ideas why please?



    What actually happens when you try the code above?

    It might be that you’re using a URL, sometimes that doesn’t work (some hosts disable that feature for security reasons).

    Try a relative reference, like:

    <?php require('tips/wp-blog-header.php'); ?>

    That way, PHP knows you are calling a file within the internal file system, and not something over the internet.

    Actually, I’ve just thought, since you’re putting that in a theme file, you’ll need to modfify the path. This one below might do the trick:

    <?php require('../../../tips/wp-blog-header.php'); ?>

    Hi Maerk

    You’re a beauty! Spot on with your first call. Changed the url to a . and take a look:
    Works brilliantly!

    Now I have a list of categories, I just need to work out how to do a random post!



    Hi All

    I got the random post thing to work by applying the advice from Kafkaesqui at:

    Now all I have to do is to get it to respond to some css and also only display a part of the tip – not the whole lot!

    Thanks for all the help


    Random post… that’s a bit more tricky. If wordpress has a ready-made argument that you can pass, so much the better, but if not you might have to work something out yourself. It shouldn’t be too hard, actually, I’ll take a look at it when I get back home.

    Yeah, I was just going to suggest that method.

    To get it to display only part of the tip, you can use the_excerpt(); instead of the_content();.

    More about the_excerpt();:

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Feeds and Displaying them’ is closed to new replies.