Creating a custom post template

  • dwickham

    #2318

    I am using the “Custom Post Template” plugin so that I can display certain posts with a one column layout, while the rest of my site will display the 2 column layout that I have it set to.

    Most people seem to say that I need to make a copy of single.php for my custom template (I named it “one column”), add the “Custom Post Template” plugin code at the start which is:

    <?php
    /*
    Template Name Posts: one column
    */
    ?>

    and then I need to delete the line:

    <?php
    $k_option['showSidebar'] = 'blog';
    get_sidebar(); ?>

    However the Graphene theme’s single.php file doesn’t have any lines like that. So I guess my question is how would I go about creating this template with the Graphene them?

    Thanks

    dwickham

    #19758

    No one knows? :/

    Mod

    Kenneth John Odle

    #19759

    I’m not sure that this is possible using a child theme.

    You might want to try this plugin, however:

    http://wordpress.org/extend/plugins/custom-post-template/

    dwickham

    #19760

    Yes that’s the plugin I am using. I just want to know how to edit the file to remove the sidebar. I cannot see any get_sidebar(); function in the file to remove.

    Thanks for your reply

    Anonymous

    #19761

    The get_sidebar functions are in the header.php file.

    Just be careful editing core code. I always keep a notepad document with my changes to core code, so when I update I remember all the changes that must be made… otherwise, you’ll have a lot of extra work to do.

    dwickham

    #19762

    I would have thought that using a different template on a specific post would be fairly easy :/

    dwickham

    #19763

    Thanks for that. Sorry for stupid questions, but since I am using a copy of my single.php for the Custom Template Plugin, would it be possible to make a copy of the header.php file, with the sidebar function removed, and point my template file to that instead?

    dwickham

    #19764

    Thought I would post the solution in case anyone else is looking for it.

    Using the Custom Posts Template plugin, I made a copy of the single.php file, renamed it onecolumn.php

    At the top I added the Custom Posts Template plugin code:

    /*
    Template Name Posts: onecolumn
    */

    And then I added in this code just above the header() function.

    global $graphene_settings;
    $graphene_settings['column_mode'] = 'one-column';

    Anonymous

    #19765

    Hey, great job!! I like how you made use of it on your photo pages.

    MHankins

    #19766

    Hello,

    Great topic, helped and achieved what I wanted to. However, I’ve tried everything I know and can’t figure it out: What I need is I want the left sidebar to remain, but the right side to be gone. I’ve looked through a few files for a hint and just can’t find it. Is this even possible, and if so, can anybody tell me what I need to do? I’ve done google searches for WordPress column_mode as well as graphene column_mode and couldn’t find anything.

    Thanks in advance!!

Viewing 10 posts - 1 through 10 (of 13 total)

  • 1
  • 2
  • You must be logged in to reply to this topic.