warning: Creating default object from empty value in /home/nagar/abhishek.nagar.me/modules/taxonomy/taxonomy.pages.inc on line 33.

wordpress

19
Oct

Random Link for Wordpress Blogs

I recently started my Photo Blog, after various considerations i choosed Wordpress for it, currently i have more than 20 photos posted on it which is not actually a big number but i found that the older images or posts will never be seen to the readers as they don't appear on the frontpage for more than 4-5 days, which created a requirement of creating a Random Link on frontpage to show a Random post to the user if he wants to and this began search for a module or a plugin as its said in wordpress.

But No Luck i found various plugins but i needed something very very simple so i thought going by the code which lead me using the following code in my header.php to create a Random Post link

<?php
$randomPost = $wpdb->get_var("SELECT guid FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY rand() LIMIT 1");

1
Jan

Size of Tags in Tag Cloud

Tag Cloud is one of the best widgets available in Wordpres at times we use it as a Widget at times its part of the theme but the size of tags goes on increasing as we add posts under the tag which at times doesnot look nice we can control the behaviour of this Tag Cloud, if you have installed this as a Widget then edit wp-includes/widget.php file find the following section in it function wp_widget_tag_cloud($args) { extract($args); $options = get_option('widget_tag_cloud'); $title = empty($options['title']) ?
Syndicate content