Display the last modified date of your wordpress posts

November 17, 2008

Do often edit your published posts to update or complete it? If yes, I guess you’d like to be able to display the last modified date. Good news for you, here’s a complete code to do that. In your single.php and/or inde.php, look for the following line: Posted on <?php the_time('F jS, Y') ?> And replace it by: Posted on <?php the_time('F jS, Y') ?> <?php $u_time = get_the_time('U'); $u_modified_time = get_the_modified_time('U'); if ($u_modified_time != $u_time) { echo "and last modified on "; the_modified_time('F... [Read the full story]

Display wordpress page loading time and number of queries

November 16, 2008

Do you ever asked yourself how long it took for your page to load, or how many sql queries were executed? If yes, here is a simple code to insert on your template. Nothing hard here. Simply paste the following code on your footer.php file: <?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds. The get_num_queries() function returns the number of executed query during your page loading.  Read More →

List wordpress latest registered users

November 15, 2008

If you allow user registration on your blog, listing your latest users along with their url could be a good thing to get more users. But there’s no WordPress function to do that…… Just paste the following code anywhere on your template. It will list your 5 latest registered users. If you want to get more or less users, simply change the 5 in the SQL query. <h2>Latest registered users</h2> <ul> <?php $usernames = $wpdb->get_results("SELECT user_nicename, user_url FROM $wpdb->users... [Read the full story]

Displaying Wordpress Category RSS Feed Link

November 15, 2008

Here is the function that controls the feed link of category as globally set by WordPress: <?php get_category_feed_link($cat_id,$feed) ?> Basically it returns the category feed link. $cat_id is the category id. $feed should be replaced with feed name. Most probably you can use something like this: <?php get_category_feed_link('14',''); ?> That function tells wordpress to return feed link for category with ID 14 and default feed name RSS 2. Ok that is good progress. But it will not print the results to browser... [Read the full story]

Create a Save to Delicious button for wordpress

November 14, 2008

Social bookmarking sites can bring you a huge traffic, but being featured on popular sites as such as Delicious.com isn’t easy. To achieve this goal, paste the following code within the loop, on your single.php file. <a href="http://del.icio.us/post?url=<?php the_permalink();?>">Save this link to Delicious</a>  Read More →

Page 6 of 10« First...«45678»...Last »