Wordpress Post from a Category

4 replies
Hi All,

I'm having a bit of an issue trying to have a page just display the posts from one category. I'm using exec-php to allow the posting of php and the following code:

Code:
<?php query_posts('category_name=Reviews&showposts=100'); ?>
<?php while (have_posts()) : the_post(); ?>
<div><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a> </div>
<?php endwhile;?>
Unfortunately its returning the list and then all the other posts with the content, it can be seen at my website (I don't have enough posts yet for urls) freshbizoppsdotcom/reviews - remove the dot for a '.'

Apologies if this breaks a rule, if it does i'll change it but it helps show the issue

Any help is greatly appreciated!

Thanks
#category #post #wordpress
  • Profile picture of the author Kirk Ward
    Hi Ally,

    Not sure, but I think wordpress builds a page for the category all unto itself.

    Say your category is "birds," then if you provide a link to www.yoursite.com/birds/ then a page will appear listing all the posts in the category "birds."

    Would that do what you want?

    Kirk
    Signature
    "We are not here to sell a parcel of boilers and vats, but the potentiality of growing rich beyond the dreams of avarice."

    Dr. Samuel Johnson (Presiding at the sale of Thrales brewery, London, 1781)
    {{ DiscussionBoard.errors[1245750].message }}
    • Profile picture of the author Ally3009
      Thanks Kirk, I had forgotten about that, the main issue I have is that I have the Reviews section in my menu which uses the wp pages function to show them. So if I used that I would have to add it manually (which may work). I could also use a php re-direct to that domain.com/page/

      I'll go and have a play with it and see what happens.

      Ally
      {{ DiscussionBoard.errors[1246060].message }}
      • Profile picture of the author Kirk Ward
        Originally Posted by Ally3009 View Post

        Thanks Kirk, I had forgotten about that, the main issue I have is that I have the Reviews section in my menu which uses the wp pages function to show them. So if I used that I would have to add it manually (which may work). I could also use a php re-direct to that domain.com/page/

        I'll go and have a play with it and see what happens.

        Ally
        Ally,

        There is also a plugin called "redirect" which may have some flexibility built into it. Takes advantage of the wp-permalink system. Set up a dummy page and have it redirect to the category.

        Kirk
        Signature
        "We are not here to sell a parcel of boilers and vats, but the potentiality of growing rich beyond the dreams of avarice."

        Dr. Samuel Johnson (Presiding at the sale of Thrales brewery, London, 1781)
        {{ DiscussionBoard.errors[1246068].message }}
        • Profile picture of the author Ally3009
          I'll have a look at that plugin. At the moment I've redirected manually. I've also just seen how to get around the page listing by excluding categories using the following code

          Code:
           <?php wp_list_pages('exclude=17,38' ); ?>
          Where the numbers are the id's of your pages

          Ally
          {{ DiscussionBoard.errors[1246187].message }}

Trending Topics