by Bhumi // Oct 28,2012 // 2 comments
Here I come with quick but useful tips in wordpress.Recently I have upgraded my blog theme and I wanted to make some changes on last post found in loop on the last page.So I thought is it quite difficult to get last post?
No,Its not difficult and specifically in wordpress if you have good knowledge of wordpress core variables and functions so simply place explained code in below.
Let’s have a look into the condition which compares the total number of posts to the current post number:
|
1 2 3 4 |
if (($wp_query->current_post + 1) == $wp_query->post_count) { echo '<div>Your code place here</div>'; } |
Here, Wp_query property is used to count the number of posts and $wp_query->current_post gives us the current loop number.$wp_query->post_count will give a count of posts.
That’s it.It is so simple. Now you can make layout changes for last record of loop.
Thanks for reading and feel free to share your thoughts, don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.
The Best E-Commerce Plugins for WordPress
Here is the new guest post by katie,here you will get idea about thw best E-Comerce plugins for WordPress. WordPress templates can make it fast READ MORE
To Delete Taxonomies from database in wordpess
Basically, Latest version of wordpress have by default 2 categories. Tags and categories. Few days back,my friend asked me ,how can i delete terms from READ MORE
Remove suffix from taxonomies in WordPress
Right, I’m back after break as I was busy in stack overflow.Today I’m a going to go over how to replace some text or suffix READ MORE
Tips to Choose Your Next WordPress Theme
In this guest post by Anny,you will get tips to Help Choose Your Next WordPress Theme WordPress templates can make it fast and simple to READ MORE
In this article, I will explain you about the fundamentals of the WordPress Cron Job.Cron is basically a task scheduler that periodically on a given READ MORE
Be a Contributor at CreativeDev.Write an article or tutorial to the community and share some of your knowledge!
With bountiful of new features and bug fixes, WordPress 3.5 surely made some remarkable improvements in the platform. The new update will definitely help WordPress to retain its throne in future. Kudos for the work of core developement team.
Great improvements but hiding blogroll is not a good idea some blogger are still love to use those
finally i found a fix to enable blogroll
http://www.shoutgeek.com/enable-blogroll-links-wordpress/