• Resolved Hazlo

    (@hazlo)


    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

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

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • 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 https://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.

    Thread Starter Hazlo

    (@hazlo)

    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.

    You’re welcome. It was a great moment indeed ??

    Thread Starter Hazlo

    (@hazlo)

    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

    codex: https://codex.www.ads-software.com/Function_Reference/is_page

    try:

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

    Edit: Answered

    Thread Starter Hazlo

    (@hazlo)

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

    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?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Changing the Content Width of a Single Page’ is closed to new replies.