Displaying blog roll in template

I hope someone can help.
I am currently using the studio theme but I have a need to display one of the categories in a differently styled page (not the studio theme). I have created the template to display the category in a list fashion, and it works how I want it to.
However, when I click on one of the links it displays the post in the studio theme.
Is there a way I can have it so that the list will display within the same page, or a differently styled page?
I'm not seeing how to do that. I think I have been looking at it to long and need a fresh pair of eyes.
thanks...here is the code minus the styling have on the real page:


<?php if($bp_existed == 'true') : ?>
<?php do_action( 'bp_before_blog_page' ) ?>
<?php endif ?>
<div class="page" id="blog-page"><!-- start #blog-page -->

<?php wp_list_categories('include=3&title_li=<h2 class="teal">' . __('Recipe Index') . '</h2>' ); ?>

<?php wp_list_categories('orderby=id&show_count=1&use_desc_for_title=0&child_of=3&title_li='); ?>

  • bkeller99
    • Site Builder, Child of Zeus

    Thanks for responding Tammie.
    Whichever is easier, but all I'm trying to do is to get the post results to display in a template other than the studio theme. Its an isolated page that is not part of the theme.
    This particular template is smaller in width which is why I can't use the primary studio theme to display the post.
    Hope this clarifies it.

  • bkeller99
    • Site Builder, Child of Zeus

    a little more clarification Tammie:
    I looked at modifying the single.php file and creating a separate one for the recipes category the problem is that it will display it globally within the theme. As I mentioned this is an isolated scenario of a page(s) outside of the main theme for displaying the recipes category.
    What I'm trying to do is -- from the template file that has the wp_list_categories statement in it, tell it which modified-single.php file to use. I don't see how to do that.
    hope this is even clearer.

  • Tammie
    • WordPress Wizard

    Sorry this one seemed to have got itself not showing in my feed. I do apologise for the time to respond.

    I'm still a little confused to be honest so sorry there - you want to get 2 themes being used but show posts in one?

    As I appear to not be quite getting what you require if it's ok going to ask for a second opinion and hopefully get something for you. We can advise but it may be heading into the realms of custom work. I will leave it up to their call.

  • Mason
    • DEV MAN’s Sidekick

    Hiya bkeller,

    If I understand what you're trying to do, you'll actually have to customize your single.php file with a series of if statements.

    So, within single.php you'll have something like this:

    if ( in_category( 'recipies' )) {
    	// Do template_part for recipies... (IE you can do the styling/custom bits in a separate file)
    } elseif ( in_category( array( 'Other Categories', 'Different Styles' ) )) {
    	// We can set other categories to have other styling if we want.
    } else {
    	// Then the default for every other category is to finish out the single.php file.

    Hope that helps. Here's some information on conditional category statements and template parts:


  • bkeller99
    • Site Builder, Child of Zeus

    almost gave up.
    I think I am asking how to call a different single.php file than the one defined in the theme.
    Lets see if I can make it a little clearer.
    I have a page that is a recipe list: http://creativecookingmedia.com/recipe-index/
    It is a blog roll that consists of a primary category of Recipes and multiple sub categories. When a person clicks on one of the recipes ( i.e. cat link) it gets opened like normal via the themes single.php file, as you can see when you click one of the recipes in the above link.
    Okay here is where the fun begins...
    I have a Facebook fan page setup that is using the new iframe apps to display html pages.
    So I have created a template file that displays the recipe list in the FB fan page size of 520px as you can see by going to http://www.facebook.com/pages/Creative-Cooking-Media/164061506946727?sk=app_258737950809861
    But...as you can see when you click one of the recipes it opens the single.php file that is part of the theme I am using (your wonderful Studio theme).
    What I would like to do is create a unique single.php file that can be called for use within the FB fan page.
    Hope this makes it clearer.

  • bkeller99
    • Site Builder, Child of Zeus

    Thanks for the quick response. I looked at this before and it won't solve my problem.
    On my the site the single.php is perfect.
    Using my previous post as a reference ...I need to have a different display from within FB only. The solution you provide lets me have a different display(cat1_single.ph) per category and thats not what I am looking for. Like I said, from within the site the theme is set up the way I want it. I have not come across any documentation that allows more than one single.php files to exist. I was hoping there was a way to call a separate single.php file from within the FB template I created, but there doesn't appear to be.
    ( further: If you go to the Facebook link above and click on one of the recipe links you'll see exactly what I'm talking about)

  • Mason
    • DEV MAN’s Sidekick


    Whew. Understanding that we're talking about a facebook iframe really changes things a bit.

    I have not come across any documentation that allows more than one single.php files to exist. I was hoping there was a way to call a separate single.php file from within the FB template I created, but there doesn't appear to be.

    No. I don't know of any way to do this. There's no way WordPress knows that it's content is being delivered inside an iframe.

    You can possibly do it through some custom javascript/jQuery snippet:
    var isInIframe = (window.location != window.parent.location) ? true : false;
    And then load particular styling because it's in an iframe, but I don't know of any plugin/solution based in WordPress for this.


  • Mason
    • DEV MAN’s Sidekick


    As we haven't heard back from you we're going to assume the problem
    was sorted out and mark this ticket as resolved.

    If it wasn't resolved, or you have any more questions related to this
    thread please feel free to post them below and tick the 'Mark as Not
    Resolved (re-open)' box below the post area (or else we'll miss it!)

    Otherwise, thanks for using the forums, and for being a member of WPMU
    DEV, it's a pleasure to help you out and we look forward to being of
    assistance in the future.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.