Forums

[resolved] Template problems with slugs (6 posts)

  1. yellow hamster
    Member
    Posted 1 year ago #

    Really nice theme, but I'm having problems with the templating system.

    Custom pages like author.php, category.php work fine.
    However, when I try file names using slugs, for example cat-{slug}.php, meta-{key}-{value}.php or author-{username}.php the custom template is not selected.

    I've double checked that I'm using the correct slug in each case, and since my custom files are copied over from equivalent files, I don't think that's the problem either (eg author-yhamster.php is simply a copy of author.php with the line of code <p>yhamster author page</p> added appropriately.

    Anyone else having the same problem?

  2. mercime
    Member
    Posted 1 year ago #

    For category-specific pages, create file names with POST ID not slug, e.g. category-5.php
    See http://codex.wordpress.org/Category_Templates

    For author-specific pages, it doesn't work the way you did it unless you add plan to publish EACH author-username.php template as page templates and generate the link. Then you could hard code links to the specific author pages that way.

    To auto generate author pages which you could link from posts via <?php the_author_posts_link(); ?> in post meta
    see http://codex.wordpress.org/Author_Templates#Sample_Template_File

  3. yellow hamster
    Member
    Posted 1 year ago #

    Thanks for your reply mercime.

    However, I'm posting about the Carrington theme. I should have made that clearer in my original post. The Carrington theme uses a custom template system described here, so I don't think the advice above applies.

  4. mercime
    Member
    Posted 1 year ago #

  5. yellow hamster
    Member
    Posted 1 year ago #

    In case anyone is interested, I've posted my question on the crowd favourite forum

  6. yellow hamster
    Member
    Posted 1 year ago #

    This problem is fixed in version 1.2.

Topic Closed

This topic has been closed to new replies.

About this Topic