WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Help with categories and how best to display different images on templates (5 posts)

  1. markymark2007
    Member
    Posted 6 years ago #

    I'm trying to create a new site and I'd like to know if it's possible to create a variable which will contain the category_id of any selected post within the Loop so that I could then use the variable in conjunction with a case statement to display the correct html information relating to that post from around 20 different categories.

    I'd like to keep it simple and stick to using the templates that come with WP. I dont want to create 20 different templates if at all possible.

    I'm not a programmer so please be as clear as you can be with any help..

    Cheers
    mark

  2. moshu
    Member
    Posted 6 years ago #

    If you are not a programmer - then use a plugin that makes that possible... and there is no such thing that "the templates that come with WP".
    Classic comes with 7 files and Default with 16.
    You make and use as many templates as you need for your customization.

  3. markymark2007
    Member
    Posted 6 years ago #

    But I dont want to create 20 templates, that's the point...

    So is it possible do to grab the category_id and then store it within a variable within the loop?

    I'm using themed templates and not the classic or default. Sorry about the confusion.

    Thanks
    mark

  4. markymark2007
    Member
    Posted 6 years ago #

    To further expand upon my reasoning for not wanting to create multiple pages and irrespective of the number of page requirements.

    I will need to put my proposed solution in place on all pages (x 20), so you can probably guess why I dont want to take the route of creating individual pages for each category/page instance and therefore some conditional code would be the ideal solution, at least that is my ideal world solution.

    I hope that's of some help...

  5. markymark2007
    Member
    Posted 6 years ago #

    I have sorted this out myself.

Topic Closed

This topic has been closed to new replies.

About this Topic