WordPress.org

Ready to get started?Download WordPress

Forums

Show one post, then a list of the rest (in the current category) (7 posts)

  1. yollyflopp
    Member
    Posted 2 years ago #

    I have a problem that I've tried a lot of different solutions for. But none does exactly what I want. The thing I want, is to do this:

    When I'm in a category (and in a single post), I want the fist post to be shown with it's title, content, thumbnail and so on. Then below that I want THE REST of the posts in the same category to be shown with just their title.

    So if we say that I have a category called "Balls", and in that Category there is 4 posts; "about balls", "footballs","baseballs" and "tennis balls".

    So if I go to "Balls" I want see:

    About balls thumbnail
    About balls title
    About balls content

    Footballs title
    Baseballs title
    Tennis balls title

    And if I click on "baseballs" I want Baseballs thumbnail, title and content to be shown and "about balls"-, "baseballs"- and "tennis balls"-title to be shown below, and so on.

    So what I want to do is have all the posts from the current category, show one as a post and the rest as a list. Simple as that.
    And in the single post I want to show the rest of the posts in the sam category as a list. Should that be so complicated?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Do these posts have different tags?

  3. yollyflopp
    Member
    Posted 2 years ago #

    There are no tags yet, I'm in the development state right now.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    This should be possible via a category template and some changes to your single.php template file. I'd suggest you read up on multiple Loops and have a look at:
    http://codex.wordpress.org/Function_Reference/get_posts
    http://codex.wordpress.org/Function_Reference/WP_Query

  5. yollyflopp
    Member
    Posted 2 years ago #

    Yes that's what I'm been doing, but I got so frustrated that I didnĀ“t get it so work as I wanted. Either It showed all the latest posts (from every category) or just the post from one category ID or listed all the posts from my category (the active one included).

    Thats why I posted here.

  6. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    to get a base to work from, can you paste the full code of category.php (or the category template you are using) and single.php into a http://pastebin.com/ each and post the two links here?

    can you also post a link to your site to illustrate the output of these two templates?

  7. yollyflopp
    Member
    Posted 2 years ago #

    As of right now i work in the indexpage, but I attached the link GRAFISK PRODUKTION to my category-php now and that code looks like tis:

    http://pastebin.com/QdzmCpyC

    You can find it here http://213.88.224.72/?cat=11

    The post looks almost the same. So no need for that now...

Topic Closed

This topic has been closed to new replies.

About this Topic