• Hi all I have seven categories. On each of the categories main pages I have a different block of code (php/html) that I want to show.

    Should I set up 7 new pages, put the individual code for each category in there and then include the category posts in those new pages?
    Or should I include the block of code in the category page? Thanks I’m a bit confused

Viewing 9 replies - 1 through 9 (of 9 total)
  • Instead of having a category template for each category, I’d probably go with one category template and code it accordingly.

    Of course, if you used something like https://www.ads-software.com/extend/plugins/allow-html-in-category-descriptions/ you could have just one category template and code it to display the category description which would contain your text/html for each category.

    Thread Starter Copywrite

    (@copywrite2012)

    Thanks for the replies, esmi I checked out the page and it seems I can use this code changing the strings “Category X” to the names of my categories and putting in the relevant html/php there.

    <?php if (is_category('Category A')) { ?>
    <p>This is the text to describe category A</p>
    <?php } elseif (is_category('Category B')) { ?>
    <p>This is the text to describe category B</p>
    <?php } else { ?>
    <p>This is some generic text to describe all other category pages,
    I could be left blank</p>
    <?php } ?>

    Michael H that plugin looks interesting but what does it mean by “This plugin does not do anything other than disable the filters.” What are the filters?

    That plugin essentially allows you to put html in a category description so suggesting you enter your html stuff in the category description, then you don’t need to code specific text for each category.

    I think the filters normally strip HTML from category descriptions.

    Thread Starter Copywrite

    (@copywrite2012)

    Why on earth would I want html in my descriptions?! ??

    For your individual category texts?

    Thread Starter Copywrite

    (@copywrite2012)

    That is what I’m using my conditional php code for- wouldn’t any html that is put in the description be in the header, or am i missing something?

    The category description field can he used in whatever template you want.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Should I use a page or a category?’ is closed to new replies.