• Resolved _beatrice_

    (@_beatrice_)


    I havent really messed around with theme files so I am wondering if this question is a bit too loaded…or harder than I can handle at this point:

    Can I make a current page template (basic blog post page with sidebar) in the theme to NOT show the sidebar YET fill the width of the page instead?

    I have figured out how to deactivate the sidebar, but not fill the page across. Some of the WP plugins allow custom activation per post or page of the widgets. I want a basic “blank” page layout with the title only instead of the current details that appear.

    The purpose of this change is to convert the current theme page “portfolio” into a clean page and not one with details on it (widgets, etc.). So it would affect only that page template, not the other blog posts.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Moderator Kathryn Presner

    (@zoonini)

    Can I make a current page template (basic blog post page with sidebar) in the theme to NOT show the sidebar YET fill the width of the page instead?

    Sure, you can do this with most well-coded themes, by manipulating the CSS. There are many different ways to do it, but in a nutshell you want to find the ID or class for the main column and widen it up in your CSS for the pages you’ll be using the template on.

    Let us know if you need more help with this.

    Thread Starter _beatrice_

    (@_beatrice_)

    Using CSS Edit I looked at the style sheets for the page I want to change. Each portfolio page uses the same style.css and grid.css as each blog post page. So how can I make this change to only apply to the Portfolio pages in my theme?

    Moderator Kathryn Presner

    (@zoonini)

    Is the site online yet? If so, could you provide a link? It’ll be easiest to help if I can have a look at your site.

    Thread Starter _beatrice_

    (@_beatrice_)

    it is under construction with all the changes right now. Here is a test site that is mirrored the same:

    Test

    The galleries were on the main menu to show each portfolio category, but it stopped working for some reason. I hope this would help either way though!!

    Thanks for looking!!

    Thread Starter _beatrice_

    (@_beatrice_)

    Oh, so if you look at one of the detailed pages on the gallery page, I would like to have the featured image hidden, the text of the post across the whole page, and all widgets on the sidebar gone. Is that too much for a girl to ask!? hee hee

    Moderator Kathryn Presner

    (@zoonini)

    Excellent – very helpful!

    If you look your code on Kitchen Item #4, see this line?

    <body class="single single-portfolio postid-136 single-format-standard">

    Here’s what I’d do. Your gallery pages have <body> class called single-portfolio. Your main column is assigned a div called content.

    So what you need to do is put a style in your CSS that goes something like:

    .single-portfolio #content {
      width: 100%; /* put whatever you want the width to be */
    }

    See if that works.

    FYI – the odd thing is I do see full-width CSS referenced in your stylesheet code, so perhaps you already had a full-width template in your theme:

    #full-width #content

    Moderator Kathryn Presner

    (@zoonini)

    To hide the featured image you’ll need to go into whatever file it’s coming from (depends on your theme – could be single.php, loop.php, or somewhere else) and wrap it in a conditional tag.

    i.e.

    <?php if (!in_category('portfolio')):
    
    //do featured image stuff
    
    endif;
    
    ?>

    That means “if the post is not in the category called ‘portfolio’ then display a featured image.”

    Reference:
    http://codex.wordpress.org/Function_Reference/in_category

    Thread Starter _beatrice_

    (@_beatrice_)

    Yes, I have a full width page template; the default template page does go full width and it works with what I want it to do …BUT… the downfall is that I lose the functionality of selecting the page as a portfolio page template to have it appear in the full portfolio page. So if I don’t use the Porfolio template, I wont have this gallery. Does that makes sense?

    Thread Starter _beatrice_

    (@_beatrice_)

    I have this code in the single.php and if I try to delete it or comment it out, the thumbnail still appears. I thought this is what needed to be edited….. ???

    <?php echo '<div class="featured-thumbnail">'; the_post_thumbnail(); echo '</div>'; /* loades the post's featured thumbnail, requires WordPress 3.0+ */ ?>

    Moderator Kathryn Presner

    (@zoonini)

    Try this out:

    <?php if (!in_category('portfolio')):
    
    echo '<div class="featured-thumbnail">'; the_post_thumbnail(); echo '</div>'; /* loades the post's featured thumbnail, requires WordPress 3.0+ */ 
    
    endif; ?>

    p.s. if you comment out or delete the thumbnail code altogether and you still see the thumbnail, then it’s got to be in another file.

    Thread Starter _beatrice_

    (@_beatrice_)

    I have tried it in three spots and it still appears. I dont understand. My FTP app keeps crashing on me tonight. I am not sure I can get this to work at all.

    Thread Starter _beatrice_

    (@_beatrice_)

    thank u thank u!!
    I added the CSS for the single portfoilio and it works!! I also selected a thumbnail in the grid.css and made it hidden. it now hides them on thr portfoilo and blog entries. Prefer if it was on only the portfolio. Can the blog ones be coded on a per post basis?

    Moderator Kathryn Presner

    (@zoonini)

    Glad you got the full width working.

    I suggest you start a new thread for the thumbnail issue, and hopefully someone can help.

    Thread Starter _beatrice_

    (@_beatrice_)

    Yes, the thumbnail issue seems a bit tricky compared to the full width issue. I tried to adjust each occurence of the thumbnail in the php files but it would never work. Maybe its my syntax – but I try to match it to what you provided. Nothing seemed to work. When I edit the CSS it work for those portfolio page and the blog. This may work just fine until I find another avenue (and I will post a new thread).

    Thank you so much for the help! I couldn’t have done it without you!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Change page template in theme’ is closed to new replies.