Creating static pages in Blogger
Update Jan 2010
Finally Blogger has come up with the much awaited (static) Pages feature. So now you no longer need this hack to create static pages. However, you still have to do some coding if you want to make the static pages look different from other pages. Please refer to this tutorial: Apply different layout/styling to static pages
Update 3 Oct 2009
Now you can truly prevent static pages from appearing in homepage, without the need to backdate the posts. I’ve edited much of the post. Some of the comments prior to this update will seem irrelevant.
As you may know you can’t create static pages in Blogger. What we can do is mimic static pages using posts. You can use “static pages” for your About, Privacy Policy, Contact Us pages or other info about your blog.
So how does a static page differs from a post? First of all it should not show up in homepage. Secondly, there should be a link to the static page in the homepage. Thirdly, it should look more like a page than a post -without comments section, timestamp, blog pagers (those newer and older posts links) or any other elements associated with a blog post.
Let’s get started.
1. Label your “static page” post
Apply a label your “static page” post before publishing it, or apply it your existing post. Choose a unique label and make sure no others labels are to the post.
For the purpose of this tutorial, I will use the label “static”.
2. Put “static page” link in homepage
The most common way to link to your “static page” from the homepage is by using a navigation or menu bar. If you don’t have one, here is a tutorial on how to create a menu bar.
Once the bar is added, you put the link to the page into a tab on the bar. To get the link, just follow this simple steps:
- Go to Dashboard > Edit Posts.
- Click the label “static” from a list of labels on the left of your screen. All posts labeled “static” will be listed on the right.
- Click View link next to the post to view it. The link to the post (a.k.a. the post page URL) is inside your browser’s address/URL bar.
- Copy and use that URL for the tab.
3. Remove the “static page” post from homepage
This hack will remove the “static page” post from homepage and from all other pages except the individual/post page. So in effect the “static page” post will be invisible and inaccessible to your readers, except via the link provided in step 2 and via Blog Archive gadget.
So here it goes:
- Go to Dashboard > Design
Layout> Edit HTML. - Back up your template.
- Tick the Expand Widget Templates check box on top right of the HTML window.
- In the code window, look for this line:
<b:include data='post' name='post'/>
- Replace it with the code below:
<!-- Static page hack Start-->
(Codes from line 2 until 4 prevent posts with no label from being removed too. If you label all your posts, you can omit these lines).
<b:if cond='data:post.labels == ""'>
<b:include data='post' name='post'/>
</b:if> <b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.isLast'>
<b:if cond='data:label.name != "static"'>
<b:include data='post' name='post'/>
<b:else/>
<b:if cond='data:blog.pageType == "item"'>
<b:include data='post' name='post'/>
<style> .post-header-line-1, .date-header, .post-footer, #comments, #blog-pager, .post-feeds, .sidebar { display:none !important; } #main-wrapper {width: 980px; } #main {width: 900px; margin: 0 auto;} </style>
</b:if>
</b:if>
</b:if>
</b:loop>
<!-- http://BloggerSentral.blogspot.com --> <!-- Static page hack End -->
4. Style the “static page”
Styling or formatting is done inside the style tags in line 13 until 15 of the above code. This is where we make the static page look more like a page and less like a post. In the code above, we
- Remove post-header-line-1 (which usually contains post author name and time stamp), date header, comments section, blog pager, comment subscription link and sidebars. This is done in code line 13.
- Widen the post area to fill up the spaces vacated by the sidebars. This is done in code line 14 and 15. If you want to do this too, find out what’s your header or header-wrapper width and use it here.
- Identifying and adding your own elements to the code
Your elements’ Ids and Classes maybe different from the ones given in the code above. You can find yours by going through your template code. To get an idea what to look for, here’s a sample code snippet, taken from BloggerSentral’s template:
<div id='lowerbar-wrapper'> <b:section class='lowerbar' id='lowerbar2' preferred='yes'> <b:widget id='HTML5' locked='false' title='Reciprocals' type='HTML'/> </b:section> </div>
As you can see, an element be it a division, section or widget is given an Id or Class or both. To remove it from static pages, simply add the Id or Class to the selector list in line 13. For an Id you need to add “#” prefix and for a Class, add “.” as prefix. For example if you want to remove “Translate This Page” widget, all you need to to is add
#HTML16
to the selector list.Update: For widget and section Ids you can now use How to find Blogger widget and section Id method.
5. Remove “static” label in Labels gadget (if you have one installed)
Because we introduce a label “static” for the post, that label will show up in Labels gadget. You can hide it, by simply editing the Labels gadget.
- Go to Design
Layout> Page Elements and click the Edit link in Labels gadget box. - In Configure Labels window, tick Selected Labels
- Untick “static” label check box.
- Here is the result:
Before -with “static” After -without “static”
You can look at the end result, my Privacy Policy or FAQs page. (I have transferred the “static pages” to the new Blogger pages.)
Enjoy!
150 comments to "Creating static pages in Blogger"
Good Tutorial. This will help blogger to make a static page. Thanks
aR
Bangla Hacks
aR,
I'm glad you found it useful.
I tried to use these instructions but still see the backdated post on the main blog page (complete with date over 40 days ago). The problem may be that I'm using the "new" editor. The options allow a "scheduled" date instead of "automatic". Can't see anything else that could go wrong. Please advise...
Although you don't say to I assume after backdating I have to publish as normal, if I don't I can't get a link URL with the draft only.
This a great soulotion to a problem I've been looking at for days now. If I can get it to work!
Hi JAWhite,
Static pages are "hidden" from homepage by placing them last in posts order. So to make this work you want to have a few more posts to push the static page off from view.
Its very nice and informative article. Its really very helpful in making of a static page. I had bookmarked this page its very useful for me. thanks for that.
hola greenlava..
i want to ask u, what is static pages really is..?
what is it use for and where it usually use at?
i'm trying to make my blog just like 'website'
but is it possible to make it by using this 'static pages' thing?
Termite information,
Thanks for the bookmark.
Program Sukarelawan Teknologi (PROSTEC),
If you want to make your blog looks like a website, then static pages is the thing for you. A static page is a page that does not appear in your blog home page. So it does not move down the homepage when you add in new posts. You usually access the page using a menu tab in the home page.
An example of a static page is my Privacy Policy, the link is in the footer.
can we use static page as the homepage?
Yes you can.
Use future date (like year 2020) instead of past date. Then go to Settings>Formatting to set show 1 post on homepage. That way only the futuremost page will be displayed.
Wonderful tutorial! Thank you so much. I tweeted it. When I'm ready to go public with my blog, I'll let you know so you can take a look.
Btw, is it possible to make the static post stretch across the page once we remove the sidebar widgets? I have a three-column blog. Following your instructions, I hid all of the gadgets and widgets in the right hand column. I'd love to make the post stretch to fill that column to give it more of a full-page look.
graceonline,
Thanks for the tweet :)
Yes you can stretch the post area by increasing the width of the main wrapper and its child elements leading to the actual post area.
You also need to display:none the sidebar wrapper (the outermost sidebar container) to take the sidebar completely off the page.
Hi there,
Nice information. i have a blog and i was searching this types information because i need it for my blog. thank you very much for this post.
You're welcome Logo Designs.
In step 3, number 5, I can not find data:post.body in my code to place your code before. Where is it in the code? Is there somewhere that I should look, middle, top or something?
Lynn,
Have you ticked the Expand Widget Templates check box? If you haven't you won't find it.
For ease, search using Ctrl+F.
Hi, when trying to style the page, I'm getting a parsing error, saying:
"The value of attribute "cond" associated with an element type "null" must not contain the '<' character."
I copied your code directly. Is there some variable I need to change?
Patrick,
The only variable that you might want to change is in line 6. But the error came from line 3 or 4.
I suggest you recopy the code. I don't see anything wrong with it.
Thank you, thank you, thank you! I've been trying to find a way to do this forever.
Great instructions! I failed to follow them correctly the first time, but a quick re-read helped me find my error.
Unknown Mami,
Glad you found this tutorial useful.
So far I have loved your tutorials, I made the header bar, but now I am stuck with clearing all the extra elements off of the static page. I pasted the code right before data tag but it still hasn't cleaned up the post.
I would love some help! What info do you need to help me?
J and C,
I couln't find the static page code inside your template. For me to help you, I have to see the code in action.
One more thing, I noticed your blog look a bit messed up. So I checked and found this:
#header img {
margin-left: auto;
margin-right: auto;
}
Navigation page element starts
div id='navibar-wrapper'
b:section class='navibar' id='navibar' showaddelement='yes'
/div
div style='clear: both;'
Navigation page element ends
/* Outer-Wrapper
----------------------------------------------- */
#outer-wrapper {
width: 950px;
margin:0 auto;
padding:10px;
text-align:left;
font: normal normal 108% Futura Lt BT;
}
The culprit is the one in bold (I remove the tags to prevent error here).
Just delete the line and your layout will return to normal.
I can't seem to get it to work. I added the code but the sidebar and widgets are still showing. Can you take a look please? I changed "static" to "mapping" but that shouldn't make a difference. Here is the address. http://properties4prosperity.com
All I want is for the sidebar and widgets to be removed when I place a post under "mapping"
Chris,
From the weird-looking numbers at the beginning of "Why I became Realtor", I suspect you copy the code direct from the page (i.e the numbered code).
The proper way to copy the code is:
1. Hover your mouse over the window, three icons will appear on top right of the window.
2. Click the leftmost (View source) icon, a window pops-up, displaying the unformatted code.
3. Select all and copy.
Good luck
J and C,
I rechecked and found the code. Why don't you replace it with this one:
.post-header-line-1, .post-footer, #comments, #blog-pager, .post-feeds, .date-header, #sidebar-wrapper, #HTML1, #lws_0 { display:none !important; } #main-wrapper {width: 980px; }
#main {width: 900px; margin: 0 auto;}
this code should remove all except the Adsense ad.
hi there,
appreciate your effort on creating this tutorial :)
however, i'm having problems using it. I have a few 'data:post.body/' in my templates hence i'm not sure where should i place the code in. anyway i've tried placing the code below the 'data:post.body/' one by one but it still doesn't work. is it because of the template i'm using? i've searched through all the tutorials on google but don't seem to work.
hope you'll be able to help me on this matter :) thanks!
http://the-octobertest.blogspot.com/
I've tried this tips on my blog.
Anyway, is it possible to make our-own-style URL on blogspot. such as i make the URL shown like this: www.myblog.blogspot.com/staticpage1.html
october,
If that's the case, try finding this:
b:includable id='post' var='post'
and paste the code below it
mytheory,
No, for blogspot, Blogger create the url for you. You have no control over it.
thanks for your prompt reply! I've tried the method u mentioned earlier but it still doesn't hide from my main page. do enlighten me if you have any idea. thanks :)
october,
The code won't hide it from main page. The hiding is done in step 1 -by backdating the post.
G'day.
I tried your hack but found a weird problem. It hides 1/2 of my blog not just the sidebars.
see:
http://discoveryenterprise.blogspot.com/2009/11/thisis-static-page.html
I would appreciate any help.
ta
Ralph
Thank you so much for this tutorial! I have been on Blogger for just about a year now. I am slowly learning to modify my blog as I come across things I want to change. Not having a static page was an extremely frustrating limitation! After reading (& successfully implementing) your instructions, I am much happier with my blog as I continue to figure out how I want to customize it.
I tweeted this tutorial. Thank you again!
Ralph Buttigieg,
G'day.
The problem is with the width of main wrapper.
Try changing code line 14 and 15 with this:
div#main-wrapper { width: 96% }
uthostage,
Welcome to BloggerSentral and thanks for the tweet.
Click the All Posts tab on the menu bar to see a list of tutorials.
Question I want to start classified ads locally.
I have the main page I am working on and have one ad "believe it or not a 1959 Edsel" Location is
http://bartlettads.blogspot.com
Is there a ready made format I can use for classifieds? Should I go the static page route, or should I have differnt blogs for differnt items? I'd like to keep it as simple as I can. I like to have cars, household items, free, garage sales--you know all the usual categories. All info appreciated. lanahill@att.net
you rock. thanks, mang!
HillBillyFilly,
No need to create another blog or to use static page. What you need is:
1. To label each post according to its category, for example for the Edsel post, label it "cars".
2. Create a button link for each category/label. Use this link format:
http://http://bartlettads.blogspot.com/search/label/LABEL
replace LABEL with a label. For example for "cars" button, the link should be:
http://http://bartlettads.blogspot.com/search/label/cars
What it will do is, when you click the button, all posts labeled "cars" will be displayed.
Brian Hasbrouck,
Saw it working on your blog...good job.
Hey Greenlava, thanks for taking the time to make this tutorial. :)
Right now debating between Typepad and staying with Blogger (free!) LOL... one thing I like about Typepad is their ability to EASILY add pages. This tutorial of yours intrigues me.
Question for you: If I create a page, is it fairly easy to update? I'd like to create a page of tutorials (for crafting) and thought I'd want to update it with links, etc. Your thoughts?
Thanks much!
Ted
Ted,
You update it just like any other post, via Dashboard>Edit Posts.
Wonderful, Greenlava... thank you for taking the time to answer me. I'm bookmarking your site! :)
Hi Greenlava,
Thanks for this great site. But SOS! My static homepage disappears after I entered the "hack".
By the way, is it that we can only create one static page at a time?
My blog is http://lindagervin.blogspot.com
Thank you so much for your time..
Linda & Gervin,
1. Your static post in homepage dissapeared? That's the whole idea :), to remove static page from homepage and restyle it in individual page.
But don't panic, you can prevent it from disappearing. Do this -code line 10 and 11, switch their positions (i.e put code line 10 in line 11 and vice versa).
2. You can have as many pages as you like. You can also change existing pages to static page.
You are so awesome (:
So am I right to say that it will apply as long as the post is tagged as "static"? So that I can have many "static" pages?
On a side-note, there's something wrong with my headline logo after applying this. Is it my template or is it the code?
Thank you for your generous help to us noobies >.<
Linda & Gervin,
Yup as long as they are labeled "static" (and nothing else).
What's wrong with the headline?
Very helpful tutorial, thank you!
I'm wondering wether it is possible to hide the backdated static pages from the archive widget? Mine are all on the same date. Can this date be excluded?
thanks!
There appears to be 2 logos instead of one. Pretty sure I only applied to it once though. It's okay, I'll look at it again..
Thanks again Greenlava :)
thank's
it's helping me..
Xander Kroon,
I'm afraid I can't help you on that. Tried to, but my brain went numb just by looking at the BlogArchive code :).
Linda & Gervin,
I only see one logo.
agitagat,
You're welcome.
Sorry Greenlava, the repeated logo is hidden under the post box. There's a clickable link peeking above the post.
By the way, can we add an id to something we wish to hide? I'm trying to hide the timestamp and author, but it does not have any id for me to add to the line 13.
I think this is the code that is missing the id:
(div class='meta')
(p class='author')By (data:post.author/) on (data:post.timestamp/)(/p)
(p class='comments')
(b:if cond='data:blog.pageType !="item"')
Linda & Gervin,
1. Look for this code in your template:
[div id='header']
[h1]
[h1][a href='#'][span][/span][/a][/h1]
[/h1]
[/div]
see you have two h1 tags, and in CSS you set your logo as a background to header h1 tag. Two h1 tags mean two logos.
The second one is clickable because of href='#'. href='#' takes you to the top of the current page (which makes no sense because you are at the top of the page in the first place to be able to click it ). I would suggest you change '#' to 'http://lindagervin.blogspot.com', so that it will direct you to homepage, this is the normal practice.
Here's what you do, replace the code above with this one:
[div id='header']
[h1][a href='http://lindagervin.blogspot.com'][/a][/h1]
[/div]
2. You can add id to any HTML element. Just make sure it's unique. Try this:
[p id='NEW_ID_HERE' class='author']
very useful post this. sorry but how to point the static page to your blog url?
thanx
noir,
You link it via a menu tab, as explained in step 2.
Good tutorial. It works like a song on my test blog but i can't repeat the same on my actual blog. I want to increase the static page width. Appreciate if you could you could help. Static page is at http://oldieslovesongs.blogspot.com/2009/01/english-love-songs.html
FatLadySing,
In code line 13, replace
.sidebar with
#left-sidebar, #right-sidebar
In line 14, replace the code with:
#content, #content2, .post, #inside-content {width:990px;}
Line 15, replace it with:
.single-entry {width:950px;}
Greenlava
thanx 4 the help. beautiful work. i've bookmarked your site
Hi,
Great tutorial. It was so easy to follow, especially for a lamen who is just getting into blogging like me.
I am having one trouble though:
In step 3."style the static page" part 1 where it says "Remove post-header-line-1 (which usually contains post author name and time stamp), date header, comments section, blog pager, comment subscription link and sidebars. This is done in code line 13.". I deleted that part of the code and saved it but I still have the date, comments section, etc.
What did I do wrong?
http://vettechmel.blogspot.com/
Mel, RVT,
You remove the elements by keeping the code (in line 13), not deleting it.
Thanks Greenlava for everything. I also make a mistake in the static page post. Label it as "Static" instead of "static".
Hi, I'm sorry to bother you again. I replaced the code that I had deleted (line 13), and I still have the date, comments, etc on my static pages. I'm not sure what I am doing wrong here. I've redone it so many times now.
Mel, RVT,
Your static post is labeled "Static" with capital S. Change it to "static" with lowercase s.
I tried step 2 (is that all you need to do, or do you have to do the entire thing to make a static page?), and it didn't work. First of all, you said to "Copy and use that URL for the tab." What tab? And are you using the old blogger configuration, the one that says "Add page elements" instead of "Add Gadgets"?
I've tried a number of sites, and none of them have helped because they are so unspecific!
Anonymous,
I would say step 1 and 2 is a must.
The tab refers to a tab in a menu bar. Similar to my tabs under the header (Home, All Posts, FAQs).
Try clicking the FAQs tab, you will be taken to a static page titled BoggerSentral FAQs. Notice the different appearance (as compared to other pages)? That's done in step 3.
Dear Greenlava,
I just want to thank you for your help. Your instructions are by far the best on how to set up pages in blogger.
You're welcome Ralph....
Ktynnz,
Could you be more specific?
Hello Greenlava,
I am trying to add nabble Forum to my blog at
http://www.oracledatabaseissues.blogspot.com/
under menu title 'TEST'.. The sidebars are not going correctly. Could you please give a look..
Was able to fix that as well. Please do give a look to my blog at
http://oracledatabaseissues.blogspot.com/
thanks for this article.
Administrator,
The forum looks great! :)
Can you please tweak my codes for me? I don't know how to hide the timestamp, author, and tags in my static page. Please email me at madame_k@ymail.com, I look forward to your response. :)
Madame K,
Your timestamp is inside .post-timestamp, author is in .post-author vcard and tags in .post-labels.
Place them in front of {display:none !important;}.
I can't find the .post-timestamp and that {display: none !importnant;} in my codes.
Madame K,
You don't have to find anything, just replace code line 13 in Step 3 no.5 with this one;
.post-timestamp, .post-author vcard .post-labels {display:none !important;}
Hi thanks for this code it is excellent, the best solution I have found to this problem by a long way! A couple of quick questions if I may:
1) It works like a dream except I have a date stamp 'tuesday january 29th' on my homepage where the static page post would have been - is there anyway to remove it?
2) Can more than one 'static' post be linked to the same navigation bar tab?
Thanks for the help!
I already manage to create my static page. I can click all the static page from the main page. But my problem is, i can't click from static page to see the other static page. For example i have HOME, PROFILE, ACTIVITIES and ALBUMS. I only can access all the static page from HOME page. But from PROFILE i cant click to ACTIVITIES. Everytime i do that the page "couldnt found the page" will appear. I have to return to HOME then i can go to the other static page. Whats wrong i've been done? Thanks.
Rob Pattenden,
1. It looks like your date-header lies outside of post includable. Try reposition the date-header code into it.
First backup your template, the find this code:
[b:if cond='data:post.dateHeader']
[h2 class='date-header'][data:post.dateHeader/][/h2]
[/b:if]
then cut(Ctrl+x) and paste it immediately after this line:
[b:includable id='post' var='post']
Preview before Saving.
2. Read Open multiple links / windows in a single click
Hi Greenlava,
Thanks for sharing this with us.. i was looking for something like this for past many days.. i implemented it on my blog and it is working fine..
However there are some small issues..hope you'll help me correct those..
1) When I click on the static pages from my home page, it displays the label below the post title. How do I remove that ?
2) I use breadcrumb trail in my blog (adopted from bloggerbuster.com). How do I remove this from static page ?
3)How do I remove Related Posts from Static pages ?
4)How to remove Rating Widget (from Outbrain) from Static Pages ?
As I am new to blogging and don't have much knowledge of html, i request you to help me out with these issues.. Thanks for your time..
memmie,
You didn't provide your blog url, so I'm guessing here.
You use relative urls for the links. Change them to absolute urls, like this link for example:
http://bloggersentral.blogspot.com/2009/11/blogger-sentral-faqs.html
Yes you right genius. I'm using relative urls instead of blog url. My problem solved! Thanks!!!
WOW!! Thank You!!! Quick and easy fix - you are a genius!!!! Can't wait to try the multiple links method!
Thanks again!!!!
Anshul,
Add these selectors in front of {display: none}
.post-labels, #places, .similiar, #outbrain_container_0_bottom
in code line 13.
ackkkkkkkkkkk. Timestamp keeps on showing in my static page.
Hey, just wonder how to create static page but maintain left or right sidebar?
Madame K,
Post your static page url here, maybe I can take a look what's wrong with it.
JW,
Just omit .sidebar from code line 13.
http://coffeechiq.blogspot.com/2009/12/whois-me.html
Thanks.
Madame K,
Are you sure you've added the codes? I couldn't find it in the page source code.
Oh. wait..
Ok, i updated the codes already.
I just wanted to say that I think your tutorials are excellent Greenlava, and the additional info you provide so freely in your response to comments make your blog a valuable resource. Two thumbs up!
Thanks Eric :)...have a nice trip
Madame K,
I still can't see the code.
nice tutorials... thx!!!
Hello Greenlava
I would love your help on trying to eliminate by sidebar and it's widgets from my static pages. I have spent the entire day trying to figure this out and for some reason the code will not hide my sidebar nor it's widgets! Can you please give me some insight?
My blog is:http://theroyalscoop.blogspot.com/
@フェブリヤント
You're welcome
@Jacquelyn Marie Chiovari
I see you've worked it out. I must say the pages looks pretty good, well worth the effort.
Hi
I think I have followed your tutorial correctly - thank you for it (although I haven't formatted the static page yet. But I'm left with a blank page showing just the date where the static page used to be in the sequence of entries.
The site is kevtownsend@blogspot.com. If you click the 'older posts' at the bottom of the home page posting you get a blank page with just the date. It doesn't show up in the edit posts lists.
Is there any way I can remove this 'blank' page?
@Anonymous
Try this to remove the date.
If the page still appears even after this, you need to go to post editor and backdate the static post.
Thank you - your tip half works :-) It removes the date from the ghost page, but leaves the page now showing just the 'newer', 'home' links. Have you another tip to get rid of these; and is there anyway to get rid of the static page entry in the Blog Archive sidebar widget?
Hello, I am having some difficulty with getting the static page to work as well. My static page is still visable from my homepage and the date and time is still visable as well. I went in a tried to backdate my static page but that still does not solve the problem. Did I copy the HTML code incorrectly?
Thanks for your help http:www.thealistbyairest.com
Thanks!! I'm still working on my blog, but it's already so much better. This was very helpful. I'll link my students here. Christina
@Anonymous
That's the best I can come up with right now.
As long as the page exists, I don't think we can remove it from Archive widget. Blogger archives posts by posting date. I reckon if Blogger can detect a posting date (meaning a post exists) then it will appear in the Archive.
"Newer Posts" and "Older Posts" are simply date-bound searches -again posting date comes to play here.
@Airest
One question: Have you labeled the pages "static"?
@Academic Writing Blog
You're welcome
Tried everything butthe sidebar remains! Contents gone though.
http://cyclingclubhackney.blogspot.com/2010/01/blog-post_21.html
also is it possible to stop the content from scrolling?
Thanks a bunch.. Very helpful indeed
@Stuart
1. The sidebar is gone, yet it looks as if it is still there because your post column is right aligned. To position it on the left, add this after code line 15 in step 3:
div#main { float:left !important;}
2. This is about the membership form right?
You need to edit the Zoho iframe code. Try changing scrolling="auto" to "no" and height="500px" to "800px".
Good luck
@Skeelomano
You're welcome. Datang lagi ye...
Wow very nice! Thank you. Will be great for my blog!
Excellent article! Thanks, @Greenlava. I was searching for something like this for months.
How would I modify the code above if I want to distinguish the static pages from regular posts by the fact that comments are not enabled for static pages? Thanks!
@willyp5
Use this code:
[b:if cond='data:post.allowComments']
PUT ELEMENTS YOU DO NOT WANT TO SHOW IN STATIC PAGES HERE
[/b:if]
but using this method you will have to apply the code to each element you want to hide in a static page. Let's say you want to hide 10 elements then you have to find the codes for those 10 elements in your template then enclose them in the if tags, one by one.
Fantastic! Very helpful. Now I get to play with it.
Thanks. Your approach is definitely better. The problem I have now is hiding the Linkwithin widget as well as a banner I have at the bottom of the post but above the footer. I had defined the ad as .itemad so I can format it, but including it in line 13 of your code didn't do anything. You can see at blog.lastbash.com. Also, is there a way to hide the static pages from the older pages? What do you think?
@Dan Wells
Want't to get rid of the left sidebar? Read this reply, no.1
@willyp5
For Linkwithin I use #lws_0.
As for the banner you defined the wrong div:
{div class='itemad'][/div]
[div align='center']
[a href='http://www.bawineshop.com' target='_blank']...
it should be the bottom div, the one with align='center'
To hide static pages from archive. Blogger has just introduced guess what? Static Pages in Blogger In Draft.
Thanks so much Greenlava! I got the Linkwithin widget to go away but I'm not sure I understand the itemad part. Also, is there a way to move the Linkwithin widget to below the post footer? Feel free to email me directly (email on contact page). Thanks again!
@willyp5
Regarding .itemad, this is your code (replace [] with <>):
{div class='itemad'][/div]
[div align='center']
[a href='http://www.bawineshop.com' target='_blank']...
you give class to an empty division, that's why it doesn't work. It should be like this:
{div][/div]
[div class='itemad' align='center']
[a href='http://www.bawineshop.com' target='_blank']...
I don'r think you can move the Linkwithin, it's programmed that way.
Thanks a lot for all this help. I am currently trying to set up a forum for a blog that is still in the design mode and have copied the codes you provided on how to create a static page and how to move it from the homepage. Unfortunately everything else seems to be working, but the page, which I named "FORUMS" is still on the homepage and all the sidebars are still there. Can you please help me get this up and running so my "FORUMS" page is invisible on the homepage? I really appreciate all the help you've offer so far. You can reach me at JRose733@gmail.com and my blog's URL is http://www.gettickledbyarose.blogspot.com. I would really appreciate your feedback as soon as possible. Thanks a million.
@Mrs. Rose
I don't see any "FORUMS page. I can't check what I can't see.
This is probably the best blogger tutorial I have seen - It's much less primitive than any other technique I have seen.
I'll probably point to this tutorial from my blogger template from scratch tutorial (This will be much easier then inventing my own technique, and it will save me the need to add to my tutorial a very long section that some people don't need)
Again - an excellent tutorial! Much appriciated
Hello Greenlava. Your tutorial is excellent and is working for me. I wonder if you would be generous again and help with an issue. I don't know how to fix it. Look at my static page and you will see my issue. Is it color related?
http://sheldon-equilibrium.blogspot.com/2006/01/archives.html
btw Greenlava...you have been tweeted and stumbled :)
@Sheldon
I'm looking at the page...and wonder what the issue is? Could you perhaps shed some light on it?
Hello Greenlava.
Apologies for not being clear. In my browser (firefox), the static pages appear to float far left and I would like them to float right. I have made main and main-wrapper the same=width 550. I did this because when I input the correct size for main-wrapper it stretches across the page and looks quite unsightly because of the 2 colours I am using. What I would prefer is to keep it the way it looks now but move the lighter section to center of page.
@Sheldon
Add this inside #main-wrapper in line 14:
float: none;margin: 0 auto;
Ah...excellent. Thank you my friend. It looks absolutely perfect :)
I will do what I can to share the linklove. Your instructions and patience are worth it and I will recommend your site at every opportunity.
Thank You!
OK ... everything is working fine ... one question however, how do we format the static page entry title [h3]? (i.e. colour, size &co)... I have tried a thousand ways but can't get it to work... thnx man!!!
Maybe you can help me. I had added the pages but what I really need is to center the links (added static pages) under my header. They are currently left align.
I have been trying to find the code but I can't find that either.
Here's the site: www.robbethjames.blogspot.com
Hi Greenlava,
You had helped me with the static page hack a couple weeks ago for my blog. The one thing that I'm having an issue with after putting the hack in place is that my older posts/newer posts links on the post page are now misaligned (it's fine on the home page). I'm guessing I need to move the line somewhere else but not sure where. Thanks.
@Sheldon
Thanks
@Ioannis G.
Add this after code line 15:
.post h3 {font-size:SIZE_HERE; color:COLORCODE_HERE;}
@Beth
Try adding this before ]]>
#PageList1 ul {width:580px; margin-left:auto;margin-right:auto;}
It has nothing to do with the hack. Anyway read my reply to a similar question here
Thank you SOOO much. You are a lifesaver!! It worked.
Again, thank you!
I put in the code, but all my widgets and gadgets still appear, any help?
Oh yeah, my site is http://derekandthegang.blogspot.com/, the static page is the forum link at the top of the page, the red button. Any help would be great! (P.s. someone should really make it so you can edit posts you made,)
Thanks in advance
DB
Sorry I keep posting, but you really need to let us edit posts. Anyways, I also noticed that with the code, my forum hangs dramatically aver the left side of the screen, and i cant even scroll over to see it, any help with my blog will be helpful!
@derek
Try setting the main width to 680px:
#main {width: 680px; margin: 0 auto;}
"you really need to let us edit posts" -yeah I agree, Blogger should make this possible.
Hi Mate. Very Useful tutorial but, could I use as wordpress does, select form just one category (onelabel) to show on homepage?? is that possible?
@Ruben Marcus Luz Paschoarelli
I'm afraid that's not possible. Homepage always display the most recent posts regardless of label.
Thank you for this tutorial. This is by far the best static page article, the others on the internet didn't explain how to remove author. I'm really looking to renovate my blogs and make them more functional and this post was quite a help.
Thank you so much
@Rosie
Your blog is set to private. Pls make it public if you want me checking it.
so sorry Greenlava _ I forgot that my testblogs were on private
you can access it here now
http://lnbtest-leavesnbloom.blogspot.com/p/testing-testing.html
@Rosie
I see you set pages' main-wrapper to 660px.
You need to add this:
.post {width: 640px}
the 20px difference is due to 10px (left and right) paddings.
Hi Greenlava - when you viewed the blog the settings were:
#main-wrapper {width: 980px; }
#main {width: 980px; margin: 0 auto;}
and it still looks like 660! - and you thought it was too.
this is the problem - I can't get it larger no matter what numbers I put in - thats why I thought it was because I was missing a piece of code. But when I add your
.post {width: 640px} (I amended that to 960px) nothing happens it still stays looking like 640. I am finding this the hardest thing I've ever tried to change on my template - normally I've got some degree of success but not with this increasing of the margins. Have you any idea's or should I just give up on making the pages wider?
@Rosie
We are talking about the same code right? The code in line 13 to 15?
Okay this is your present code:
#sidebar-wrapper,#search,.footer-column {display:none;}
#outer-wrapper {width: 660px; padding:0;}
#main-wrapper{width: 660px; margin: 0;}
to widen the post area to 960px, copy and paste this code to replace the existing code:
#sidebar-wrapper,#search,.footer-column {display:none;}
#outer-wrapper {width: 980px; padding:0;}
#main-wrapper{width: 980px; margin: 0;}
.post {width:960px;}
Greenlava This is what is now on my template - in those lines you have mentioned.
and its still the same size on the page - its not changing at all. I would copy and paste the code but the comments section won't allow the tags to be placed in this comments box. If you have any ideas please let me know but I think I might just have to be content with the width it is now.
@Rosie
Apparently you have two styling codes in your template.
1. the styling for static page hack -as explained in this tutorial.
2. the styling for the real static page -as explained in this article: http://bloggersentral.blogspot.com/2010/02/apply-different-layoutstyling-to-static.html
Your test page is a real static page, so no.2 is applicable.
You were changing no.1 all along and I was looking at no.2. No wonder we were getting nowhere.
Here's what to do:
1. Remove code no.1 -the code you got from this tutorial.
2. Edit code no.2 your new widths.
If you use Ctrl+F and enter #main-wrapper, you should find 3 instances.
The first one is in the main stylesheet -don't touch this one.
The second one is under pageType=='static_page' tag -this one you want to edit.
The third one is similar to the code in this tutorial -you want to delete this (the whole code from 1 to 22)
Thats it Greenlava - its working a treat. I made the post page 940px as outer wrapper etc is 960ps. Thankyou so much. Hopefully tommorrow I'll have time to do this on my main blog and get this static pages up and running. Your help is much appreciated.
What IS a static page?
@Anonymous
Static page is a page is a standalone page, that's not added to recent posts que on your blog home page. (As compared to a post, which is displayed on homepage, and pushed down the page, when a new post is published).
i tried this but it didn't work. the line 1 had been replaced with the provided code but it still appears in my homepage. are u sure i will replace that with just one line?
i really would want it to work, please assist me. thanks.
@bleep
Sorry I just could not understand what your problem is.
Anyway rather than using this static page hack, you'd better off adding Pages and use Apply different layout/styling to static pages to style it.
@All readers
I am closing the comments for this post.
This static/standalone page hack was created before Blogger introduced (static) Pages. The two components of this hack is:
1. Hide the static post from homepage, by simply labeling it.
2. Format/style the static page differently from regular pages.
Now that you can make real static pages in Blogger, this hack is no longer needed. It will still work though.
You can make a Page by going to Dashboard>Edit Posts>Edit Pages and click New Page button.
To format/style the added pages, refer to Apply different layout/styling to static pages.
GreenLava
Comments on this post are closed.