WordPress.org

Ready to get started?Download WordPress

Forums

How do I do this? (8 posts)

  1. Jaxxx
    Member
    Posted 8 years ago #

    Hello,
    first of all, I'm not sure whether this really ought to be a hack/plugin query. Secondly, I apologise if this has already been covered before, but after hours of number crunching, my brain is exhausted, and the prospect of just trying to figure out the key words to look for is too daunting.
    Anyway. I'm trying to find a way that if someone clicks on a link for a specific category, they get the usual results of everything in the category, but then I would also like to have some code specific to that category.
    e.g. i have a category called "personal accounts" any time someone clicks that link, i would like to display some text along the lines of: "If you would like to submit your own account, blah blah blah".
    Is this sort of thing possible. I'm sure that there must be a way using if statements, but like i said, my brain hurts. Perhaps someone who is more of an expert on this can help me out.
    Thanks

  2. skippy
    Member
    Posted 8 years ago #

    Yes, it's completely possible, by making small changes to The_Loop.

    Hopefully this example should help you accomplish what you want. If not, please let us know how we can help.

  3. Kafkaesqui

    Posted 8 years ago #

    More information on in_category():

    http://codex.wordpress.org/Template_Tags/in_category

  4. moshu
    Member
    Posted 8 years ago #

    Just wondering... Using category templates shouldn't work?

  5. Kafkaesqui

    Posted 8 years ago #

    It would moshu, but sort of overkill for a couple of lines difference between categories.

    Anyway, in case anyone is interested:

    http://codex.wordpress.org/Category_Templates

  6. Jaxxx
    Member
    Posted 8 years ago #

    skippy: that is perfect!
    i appreciate the help.
    my first thought was that i'd have to do different templates like moshu suggests, but I could bear the thought of having to manage them. this should work fine.

  7. skippy
    Member
    Posted 8 years ago #

    Glad that works for you, Jaxxx!

  8. Jaxxx
    Member
    Posted 8 years ago #

    just tried it out, works spectacularly

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags