I recently received a comment on one of my posts that explain how to create static pages in Blogger regarding removing the navigation links. These links are usually located at the bottom of a post and allow a visitor to navigate to the next or previous posts of the current post.
I decided to look into how to do this as it doesn’t seem that difficult to do. After some testing I managed to hide those navigational links from static pages in Blogger. Let’s look at how to do this.
A Static Page in Blogger
I have written two posts that outline two different methods of creating static pages. I won’t go into detail on how to do this here, but feel free to read the posts to find out how. Basically it does involve hiding specific post elements to make it look like a static page.
One thing I didn’t do was show how to hide the next/previous navigation links. That is what this post will do.
Hiding the Next/Previous Navigation Links
Hiding the navigation links is really easy to do, and just involves allowing a line of code to execute for regular post pages only. To hide the links, you can use the following steps:
- Follow the steps outlined in Creating Static Pages in Blogger – Part 2. You will need the dates of your static pages for the next few steps.
- Open up your Blogger dashboard, and then click the “Layout” link for the blog you want to edit.
- Next, click the “Edit HTML” link to display the HTML for your template.
- Check the “Expand Widget Templates” checkbox to expand all the widget code.
- Using your web browser’s find option, search for:
- Replace the line found above with the following lines of code:
<b:if cond='data:blog.pageType == "item"'>
<b:loop values='data:posts' var='post'>
<b:if cond='data:post.dateHeader != "June 23, 2006"'>
<!-- navigation -->
<!-- navigation -->
Replace the date in the above with the date and format you use for your static pages.
What the above code does is simply use the post date to determine if the navigation links are to be displayed. If the date doesn’t match the static page date, then display the navigation links, otherwise, don’t display the links.