Remove Navigation Links For Static Pages in Blogger

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

Blogger Logo

Blogger doesn’t natively support static pages as Wordpress does. Static pages are useful for such things as a privacy policy, a contact page, or an “about us” page. While you can’t officially create static pages, you can use posts as static pages.

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:

  1. 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.
  2. Open up your Blogger dashboard, and then click the “Layout” link for the blog you want to edit.
  3. Next, click the “Edit HTML” link to display the HTML for your template.
  4. Check the “Expand Widget Templates” checkbox to expand all the widget code.
  5. Using your web browser’s find option, search for:
    <b:include name='nextprev'/>
  6. 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 -->
    <b:include name='nextprev'/>
    </b:if>
    </b:loop>
    <b:else/>
    <!-- navigation -->
    <b:include name='nextprev'/>
    </b:if>

    Note:

    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.

Related Posts

How to Create Static-Like Pages in Blogger
Creating Static Pages in Blogger – Part 2

45 Responses to “Remove Navigation Links For Static Pages in Blogger”:

  1. C.D.A. says:

    Hi, this doesn’t work for me because if there are more posts on the page with date != given_date there a nextprev includable will be included more than once.

    For me it worked better like this:






    • C.D.A. says:

      seems my previous post was truncated :( maybe a pseudocode works

      if (blog.pagetype == item)
      {
      if (post.dateHeader == given_date)
      { nothing } //i don’t know if a negative condition works in blogger
      else
      { include nextprev }
      }

      • Paul says:

        A negative condition works just fine. You can do something like the following (in pseudocode):

        if (blog.pageType == item)
        {
        if (post.dateHeader != given_date)
        {
        include nextprev
        }
        }

  2. Kelie says:

    When I copy paste the code, I get this:

    our template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
    XML error message: The content of elements must consist of well-formed character data or markup.

    Any idea what the problem might be?

  3. kriepl says:

    yes same as Kelie above. I get the same error code. Is this because I already edited my HTML to not shot the post date at the top?

    • Paul says:

      I realized there was a problem with the code I posted. I had closed the if tag too soon. If you are still experiencing problems, I have corrected the code so you can copy the new code into your template.

  4. kriepl says:

    i figured out why i was getting that error. this may solve your issue too Kelie
    in my blog html I already had a code above the code…so all i did was move the
    at the end of that code, right before

  5. kriepl says:

    the code did not come through on my post above and it wont seem to let me post again

  6. kriepl says:

    darn the code i inserted did not come through.

    in my blog html I already had a code of b:loop above the

    b:include name=’nextprev’

    so all i did was move the
    !– navigation –
    b:include name=’nextprev’ – right before -b:if -b:loop

  7. kriepl says:

    thanks paul
    however, now the navigation is gone from the posts that are not dated with the dates of my Static pages.

    • Paul says:

      Makes sure you include != in the if statement. If you are still having difficulty, send me your template and I’ll have a look.

      • kriepl says:

        Paul, thanks. Still having issues…i sent you a link to my HTML file in a TXT file, via a link.
        I sent it through the CONTACT page on this site.

        Please let me know if you have any troubles grabbing it.
        Thanks again!!

        kevin

  8. [...] How to Create Static Pages in BloggerHow to Create a Development Blog in BloggerBlog Designing Tops for New BloggersRemove Navigation Links For Static Pages in Blogger [...]

  9. Wez says:

    I just copied your code and pasted it into my template and changed the date format and voila! It worked like a charm…thank you so much!!

Leave a Reply