• Hi,

    At the moment I’m creating a child theme from Twenty Ten, and I’m wondering how I can display posts from a single category, a category that will not display on the main news page? Also to make matters a bit more complex I can’t use the main ‘index loop’ as the category in question has to look completely different from the rest of the site. Any ideas?

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Create a category specific template in your child theme.

    Thread Starter noski2009

    (@noski2009)

    I did but when I clicked through to the post it reverted to the main theme’s style or rather the main theme’s page ie page.php
    is there a way it can go from gallery news section (which looks different from the rest of the site) to a single gallery page that has a different look from the main site but keeps the same style as the gallery page news section?

    If page.php was used, then this isn’t a category – it’s a static page.

    Thread Starter noski2009

    (@noski2009)

    Yes your right, I found out that it’s the single.php file being used to display the posts… but I can’t find a way to make an offshoot that will display differently, I take it that I can make a second loop based on the index loop, I then just need it to refer to another output other than the single.php file, sorry if this is really easy I read the above link but it didn’t refer to single.php.

    Thanks for your reply.

    Thread Starter noski2009

    (@noski2009)

    I found an answer to my question here https://bit.ly/Ztd7 though…

    $post = $wp_query->post;
    if ( in_category('14') ) {
    include(STYLESHEETPATH . '/lions-gallery-single.php'); }
    elseif ( in_category('9') ) { include(STYLESHEETPATH . '/latest-news-single.php'); }
    elseif ( in_category('18') ) { include(STYLESHEETPATH . '/tour-updates-single.php'); }
    else { include(STYLESHEETPATH . '/single.php'); }
    ?>

    This only lets me edit elements on the page where as my css is geared to edit pages… is there a way for css to edit different pages by their categories?

    Thread Starter noski2009

    (@noski2009)

    I found that you can apply a stylesheet to different categories and I went for this:

    <?php if ( is_category ('14')) { ?>
    	<link rel="stylesheet" type="text/css" media="screen" href="<?php echo bloginfo('stylesheet_directory') ?>/style-01.css" />
    <?php } ?>

    Though the above only had an effect on the archive page after much searching and stress I found that in order for it to effect the posts you have to change ( is_category ('14')) to ( in_category ('14'))

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Displaying different categories within a Twenty Ten Child Theme?’ is closed to new replies.