Customizing Single.php (8 posts)

  1. FireFox
    Posted 9 years ago #


    how do you customize a single.php posts/pages for a particular link, such as a category title?

    for example, if i have dog, cat, and rabbit as my 3 categories, and the viewer clicks on the "dog" category link on my sidebar, the single.php for the "dog" category shows up.

    i would like for that particular dog page (single.php) to have its' own static information (such as a picture of a dog and some specific headings and words on top of that single.php only)

    this would be true for the 2 other category (cat and rabbit).

    is this customization possible?

    thanks, much appreciate any info.

  2. Kafkaesqui

    Posted 9 years ago #

  3. FireFox
    Posted 9 years ago #

    i forgot to mention..

    this is for the dynamic single.php, not for the static pages that can be produced in wordpress.

  4. FireFox
    Posted 9 years ago #

    thank you very much Kaf.

    i'm little confused over the instructions.

    for my 3 categories - dogs, cats, and rabbits, do i create 3 separate customized single.php for them and renamed them:


    for each of those, i put their own pictures and whatever else i like to say for each animal on the top - before the posts.

    how do i call them from the category links?


  5. Kafkaesqui

    Posted 9 years ago #

    The default format for the template names used with the plugin would be:


    The numbers represent the category IDs. And no need to provide any links to them. If the plugin is active and the template exists for the category, it's (automatically) assigned to any post within that category, much as single.php is for all single post pages (well, unless you're using my plugin :) ).

  6. FireFox
    Posted 9 years ago #

    do i need to place the call function within header.php (or whereever the category links are located):


    what happen if i use the full urls to link to my categories (for example:


    i have those in my header.php to call the particular category.

    do i still need to use your call function?
    thanks again

  7. Kafkaesqui

    Posted 9 years ago #

    You're making this harder than you need to. First, something like:


    that is the individual category, can be uniquely "templated" through the functionality WordPress already offers:


    Now, to 'template' posts within that category, you only need to 1. install and activate my plugin, then 2. add a template for the category (i.e. single-cat-1.php) to your theme's directory. The plugin takes care of the rest.

    In other words, you do not need to call any function from the plugin.

  8. FireFox
    Posted 9 years ago #

    ok i'll run some tests

    thanks for you instructions

Topic Closed

This topic has been closed to new replies.

About this Topic