WordPress.org

Ready to get started?Download WordPress

Forums

I want category links which only contain 1 post, to go directly to the post... (7 posts)

  1. showmii
    Member
    Posted 7 years ago #

    Hi all, the title says it all...

    i have many categories, and many of the categories go to a single post... i'm essentially using the categories as a convenient way to build an index/directory.

    Is there a way to instruct the database to return a specific post, instead of a category, if the category clicked only has the one post?

    I"m finding that it's a little inconsistent the way it is, and lots of people who are linking to me are linking to a category archive instead of directly to the post...

    thanks in advance!
    -CHris

  2. showmii
    Member
    Posted 7 years ago #

    btw my site is http://www.showmii.com

  3. Sivar
    Member
    Posted 7 years ago #

    When I clicked your link -> Error establishing a database connection

  4. moshu
    Member
    Posted 7 years ago #

    1. Your blog has a DB problem.
    2. What you are asking that is inconsistent :) - category archives behave as expected: display a list of posts in that category.
    (whether it displays full text or only excerpts, that's a choice in the theme's template files)

  5. showmii
    Member
    Posted 7 years ago #

    moshu,

    yeah my host is having DB problems today...

    thanks for the reply... I'm using the Sunwear theme. I was wondering if perhaps there's a way to hack at the categories a bit and instruct them to a)look to see how many posts are in the category, and b) if there is only 1 post in the category, to call that specific post?

  6. showmii
    Member
    Posted 7 years ago #

    or failing this could you suggest a good alternative?

  7. Sivar
    Member
    Posted 7 years ago #

    An alternative would be to let your category template display posts (resp. your one post) like single.php does by using the_content() and without more-tags. That's btw, what moshu suggested when he (she? *g*) was talking about full text or only excerpts.

    Of course, you wouldn't need a category.php to do that, but I personally like it better when index.php isn't too messy ;).

Topic Closed

This topic has been closed to new replies.

About this Topic