How do I do this? (8 posts)

  1. Jaxxx
    Posted 9 years ago #

    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.

  2. skippy
    Posted 9 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 9 years ago #

    More information on in_category():


  4. moshu
    Posted 9 years ago #

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

  5. Kafkaesqui

    Posted 9 years ago #

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

    Anyway, in case anyone is interested:


  6. Jaxxx
    Posted 9 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
    Posted 9 years ago #

    Glad that works for you, Jaxxx!

  8. Jaxxx
    Posted 9 years ago #

    just tried it out, works spectacularly

Topic Closed

This topic has been closed to new replies.

About this Topic