WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] Changing the Content Width of a Single Page (9 posts)

  1. Hazlo
    Member
    Posted 2 years ago #

    Hello to everybody here

    I formerly posted in the wrong place (trouble shooting). Please excuse me for this mistake.

    I use a two columns theme (uTheme), with flexible width, and I'm trying now to customize my author pages. I'd like to get them with a content width of 100%, instead of 63%.
    So I first removed the sidebar call (in the Page Template) to free the space, but now I don't know which code I should add (and where) to overpass the posts template (only regarding the width).
    I do my best but... I don't know very much about code actually !
    Could someone help? Or tell me about a plugin that could do the stuff for me?
    Many thanks, in advance.

    Hazlo, painter

    this is the blog link

    http://www.hazlotopics.com/blog/contemporary-fresco-painting the page I'd like to customize

    http://pastebin.com/Sx8FBYne and here is the page template code

  2. Joseph
    Member
    Posted 2 years ago #

    Open header.php and find

    <body>

    replace it with

    <body <?php body_class(); ?>>

    Find the page ID of the page that you want to customise. See http://www.techtrot.com/wordpress-page-id/ if you don't know how to.

    Once you've found the page ID, open style.css and paste the following on a new line:

    .page-id-4 #content {
    	width: 100%;
    }

    and change the number 4 to the page ID number of your page.

    Lastly, open page.php and replace

    <?php get_sidebar(); ?>

    with

    <?php if (!is_page(4)) get_sidebar(); ?>

    Again, change the number 4 to the page ID number of your page.

  3. Hazlo
    Member
    Posted 2 years ago #

    It works perfectly. Many thanks Joseph for the time you took to give me a hand.
    On your blog I saw a pic a Simon Rattle. Must have been a great moment. I'd like to listen to one of his concerts too.
    Thx again.

  4. Joseph
    Member
    Posted 2 years ago #

    You're welcome. It was a great moment indeed :)

  5. Hazlo
    Member
    Posted 2 years ago #

    Maybe another little question if you are still there?
    If I try to do the same for another page it works up to the point where I try to remove the sidebar.
    I don't know how to change your code
    <?php if (!is_page(4)) get_sidebar(); ?> which is now in the page Template.
    I tried this
    <?php if (!is_page(4)(5)) get_sidebar(); ?>
    and this
    <?php if (!is_page(4)) get_sidebar(); ?>
    <?php if (!is_page(5)) get_sidebar(); ?>
    But there is a syntax error then.
    Any idea?
    Thx Joseph

  6. alchymyth
    Forum Moderator
    Posted 2 years ago #

    codex: http://codex.wordpress.org/Function_Reference/is_page

    try:

    <?php if (!is_page(array(4,5))) get_sidebar(); ?>

  7. Joseph
    Member
    Posted 2 years ago #

    Edit: Answered

  8. Hazlo
    Member
    Posted 2 years ago #

    I did it the right way and everything is fine now.
    Many Thx to all of you.

  9. jquadra
    Member
    Posted 2 years ago #

    I'm wondering what you would use to change the content width in only the posts page. Is there something I can use in place of the page id?

Topic Closed

This topic has been closed to new replies.

About this Topic