How to Add Pagination to TwentyTwelve Theme of Your WordPress Blog without a Plugin | mohanmekap.com

Source: How to Add Pagination to TwentyTwelve Theme of Your WordPress Blog without a Plugin | mohanmekap.com

How to Add Pagination to TwentyTwelve Theme of Your WordPress Blog without a Plugin

WordPress empower web administrator to spilt posts in a single page. If you have six posts in a page and if you have 600 posts then you have total 100 pages of blog posts. From wordpress administration one can easily do this by reaching to SETTINGS and then READINGS. This would provide how much of the post information you would like to have each post. Most of times in the main loop of posts even in a situation of multiple loop only main loop becomes important and pagination within the main loop happens.

The loop is the list of posts. Pagination is loop over loop. Most of wordpress theme do provide a simple list of navigation of previous and next posts. We would like to see the list of loops of loops that are the exact list of the entire bit of pagination at the front page. This is very much use full for information to be given to users as well as for search engine optimization as it continues to provide some of the most inbuilt information management and stitches each and every posts in between.

There are many plugins available in wordless directory to use pagination function easily. But as the self-hosted wordpress user you would like to have everything in coding. That is why this article is all about. While building a customized wordpress theme I have always intended about building, a theme that should have been completely customizable for the user. It is important to deactivate, all plugins before doing this customization.

After that slowly activate plugins one by one so that there would not be any chances of broke down in the site as well as pagination. It is important to look for theme template files, and the processes to observe and edit it, the processes of loop, and how loops are called on through queries or new wordpress queries. Always back up your theme template file and edit theme from hosting not by wordpress administration.

Alternatively you could create a child theme and then edit it so that anything goes wrong with it, could be retrieved and could be easily reloaded.
If it is a broken template then look at the template files in which it is broken or duplicated, and then enquiry about it in the case of any discrepancies in the visible aspect of pagination.

How to Add Pagination to TwentyTwelve Theme:

I have found TwentyTwelve theme to be the most customizable theme. It provides open handedness to web administrator so that ultimately everything needed to be done can be done with it. It is very easy to paginate TwentyTwelve theme. Log in to your hosting service. It would show you to log into cPanel login. Do this. Then you would reach to list of orders. From there select, most probably, ‘Single Domain Linux hosting’ and it would lead you to the administration area of hosting.

Then, reach to ‘single domain linux hosting’ and from it click on ‘Manage web Hosting’. Slowly, you would be reaching to manage FTP accounts, files, databases, back ups, website stats and more. Click on it to enter into cPanel-hosting. Then go to Files and then File Manager then from file manager scrolls down to wp-content, enter there. Move to themes and then enter there and choose the currently activated theme.

Supposedly, you have enabled TwentyTwelve theme, and click on it and open functions.php file. Open it with the code editor so that you could see the numbered lines in code and exact coding formulation. Just add the following functions.php code directly below opening <?php tags.
You should put this code just in the second line of functions.php file just after <?php and save and just run your website. It is important to back up functions dot php files so that if anything goes wrong with the coding then you could retrieve it by overwriting the functions dot php files.

if ( ! function_exists( 'twentytwelve_content_nav' ) ) :
 function twentytwelve_content_nav() {
 global $wp_query;

$big = 999999999; // need an unlikely integer
 
 echo paginate_links( array(
 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
 'format' => '?paged=%#%',
 'current' => max( 1, get_query_var('paged') ),
 'total' => $wp_query->max_num_pages
 ) );
 }
endif;
Pagination in mohanmekap.com

Pagination in mohanmekap.com

If you are using child theme, then it should be there always even if TwentyTwelve theme is updated. If you are using it with TwentyTwelve theme, then this function should be backed up so that in the next time when you put the code once again you do not have to search for the code once again. For example of viewing this you could refer to my website and at the front page, you could reach the footer of website so that you could see the presence of pagination out there. It also appears in categories, tags, archive pages.

Pagination is a separate process of creating a distinct list of an article or series of articles for those are in the persistent order of merit such as that of dates or other lists so that user could reach to such the level or number of articles without any difficulties. With this, it could help immensely to users who deal with reaching to particular level of the article as well as it is of immensely helpful for search engines, to show, find and categorize the number of posts inside of articles and show in orderly formats.

In this writes up I try to show up how to put up the basic pagination format. In today’s time, the more stress is on how to create the simple and faster website. Most of designing and redirection of every action could possibly lead to faster page loading times that should help immensely to webmaster for further generation of real time traffics all over. If you have a different theme, then using pagination for these themes takes slightly different approaches. Most of these pagination work through template hierarchy while closely knitting together query posts and wp query. If you have any doubts about it, you could learn about these functions or could possibly drop a comment here so that I could provide an answer or help you in solving this.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s