• I want the PAGE to allow large width photos as one column (nosidebar). so you need to be changing the layout for the pages, but it has to be an option to make the page view.
    anybody help!

Viewing 12 replies - 1 through 12 (of 12 total)
  • general and in theory:

    edit page.php and remove the code to get the sidebar – something like:
    <?php get_sidebar(); ?>

    2.
    edit header.php and make sure there is the body_class() in the body tag; something like:
    <body <?php body_class(); ?>>
    hat will give you a css class of .page on all pages, which you can use to change the style of the page to fill the space of the gone sidebar.

    3.
    (this totally depends on the theme you are using)
    add a few new styles to style.css of your theme to correct the content width and the post width to fill the new space:
    (only as an example:

    .page #content { width:100%; }
    .page .hentry { width: 100%; }

    do not copy/paste this without being sure that it fits the styles of your theme)

    if you have started with step 1 and 2, and have a link to the live site where your progress can be seen, and if you are stuck with the css modifications, you could report back with a link to your site.

    Moderator keesiemeijer

    (@keesiemeijer)

    [edit] Or check out conditional tags

    <?php
    if(!is_page('no-sidebar')) {
    get_sidebar();
    }
    ?>

    Thread Starter Nand Lal

    (@imaan)

    what I do need is an option to make a post on my site that takes the entire width of the page. Here is an example: href=”https://www.boingboing.net/2010/06/29/aziz-and-her-dignity.html#p0&#8243;

    I want to an option to make my pictures bigger on the page, so the page would take more room. JUST WANT AN OPTION.

    Thread Starter Nand Lal

    (@imaan)

    I want a option (as checkbox or radio button) in my admin dashboard when I post something and check that button then click the publish button.

    Moderator keesiemeijer

    (@keesiemeijer)

    You can give your “Page” a custom field.

    <?php
    //inside the loop
    //get custom field: key = full page, value = true
    $fullPage = get_post_meta($post->ID, 'full page', true);
    ?>

    And to show your sidebar or not:

    <?php
    if ($fullPage != 'true') { get_sidebar(); }
    ?>

    Thread Starter Nand Lal

    (@imaan)

    Thanks keesiemeijer

    <?php
    if ($fullPage != 'true') { get_sidebar(); }
    ?>

    I put above code in page.php, index.php but not working.
    Tell me proper file. I m beginner.

    Moderator keesiemeijer

    (@keesiemeijer)

    Ok in page.php put this on top:

    <?php
    global $post;
    //get custom field: key = full page, value = true
    $fullPage = get_post_meta($post->ID, 'full page', true);
    ?>

    ,
    And where it said:
    <?php get_sidebar(); ?>
    put this:
    <?php if ($fullPage != 'true') { get_sidebar(); } ?>
    Edit a Page where you want no sidebar and enter a new custom field with a name: full page and a value: true, and Update the Page

    Thread Starter Nand Lal

    (@imaan)

    still not working……….

    Moderator keesiemeijer

    (@keesiemeijer)

    It works on my development website. Did you in the editor gave a Page a custom field yet like this: https://img94.imageshack.us/img94/7594/afbeelding1q.jpg. And then clicked “Add Custom Field”

    Thread Starter Nand Lal

    (@imaan)

    yes i have this custom field and i m already use this custom fields but full page not working

    Moderator keesiemeijer

    (@keesiemeijer)

    can you put the content of your page.php in the pastebin and give us the link to it.

    Thread Starter Nand Lal

    (@imaan)

    page.php
    located here in my directory
    wp-content/themes/MyTheme/page.php

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Optional Sidebar’ is closed to new replies.