Support » Themes and Templates » Using Twenty-Ten, loop-single-cat.php possible?

  • I am using the TwentyTen theme and have an issue where I need to style the single posts for a specific category.

    The current template being used is single.php which calls
    get_template('loop', 'single');

    and loop-single.php contains all the standard single page formats.

    I created a single-music.php template which contains
    get_template('loop', 'musiccat');

    I then created loop-musiccat.php which contains the formatting for my specific posts.

    Everything seems to be in place but I can’t get it to load the single-music.php when someone clicks on a post which belongs to the music category.

    Any suggestions would be appreciated. Thanks!

    [Moderator Note: Please post code or markup snippets between backticks or use the code button.]

Viewing 1 replies (of 1 total)
  • get_template('loop', 'single'); will only ever load loop-single.php so you need a conditional to load your new single template file. assuming your category’s slug is musiccat, something like:

    if ( in_category( 'musiccat' )) get_template('single', 'music');
    else get_template('loop', 'single');

    should work.

Viewing 1 replies (of 1 total)
  • The topic ‘Using Twenty-Ten, loop-single-cat.php possible?’ is closed to new replies.