Forums

[resolved] Two Seperate Categories On One Page? (6 posts)

  1. spacebean
    Member
    Posted 2 years ago #

    Hey there fellow WordPressingians,

    I seem to have a very interesting dilemma. What I'm currently trying to accomplish is a blog (for new posts, etc.) and a webcomic running through Wordpress simultaneously, on the same page.

    What I have right now are two tables, each displaying the posts, but what I want is one table displaying only the posts in category 1 (the comics), and the other displaying all the rest.

    Am I sane? (Wait, don't answer that one) Is this possible? Any advice is greatly appreciated.

  2. samboll
    moderator
    Posted 2 years ago #

    Take a look at the category tags and see which best suits you:
    http://codex.wordpress.org/Template_Tags#Category_tags
    Clicking on any of the tags shows their useage.

  3. spacebean
    Member
    Posted 2 years ago #

    Hm, I don't think any of those give me quite what I want. Basically what I'm trying to accomplish is displaying the latest post in one category on one side of the page, and the latest post in another category on the other. I tried a <?php if ( in_category(1) ): ?> then display post code, but that only displays the post if I'm actually looking at the archive for that category. What I want is for the main index page of my site.

    Is there possibly a script that allows me to display the most recent post of a certain category? That may work.

  4. spacebean
    Member
    Posted 2 years ago #

    Solved! I kept looking around, and found the get_posts() tag, and used that and some php to call posts from each category for each table, so I have table 1 calling to category one, table 2 calling to category 2, etc.

    I'll post the specific code if anyone else wants to know how to do this.

    Thanks!

  5. schultzy
    Member
    Posted 1 year ago #

    I would be interested in that code. I am looking to do something similar. On the top of the page post the my latest "news" post. And then under it post my latest story.

  6. ram98cs32
    Member
    Posted 1 year ago #

    Could you please post the code Mr.Spacebean. That would be nice.

    thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic