Optional Sidebar
-
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!
-
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 thebody_class()in the body tag; something like:
<body <?php body_class(); ?>>
hat will give you a css class of.pageon 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.
[edit] Or check out conditional tags
<?php if(!is_page('no-sidebar')) { get_sidebar(); } ?>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=”http://www.boingboing.net/2010/06/29/aziz-and-her-dignity.html#p0″
I want to an option to make my pictures bigger on the page, so the page would take more room. JUST WANT AN OPTION.
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.
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(); } ?>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.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 Pagestill not working……….
It works on my development website. Did you in the editor gave a Page a custom field yet like this: http://img94.imageshack.us/img94/7594/afbeelding1q.jpg. And then clicked “Add Custom Field”
yes i have this custom field and i m already use this custom fields but full page not working
can you put the content of your page.php in the pastebin and give us the link to it.
page.php
located here in my directory
wp-content/themes/MyTheme/page.php
The topic ‘Optional Sidebar’ is closed to new replies.