How to add 10 hot wordpress posts

If you want to add 10 host post at your right bar, just copy and past the following code:

<h2>Hot PHP Posts</h2>
<ul>
<?php $result = $wpdb->get_results(“SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 10″);
foreach ($result as $post) {
setup_postdata($post);
$postid = $post->ID;
$title = $post->post_title;
$commentcount = $post->comment_count;
if ($commentcount != 0) { ?>
<li><a href=”<?php echo get_permalink($postid); ?>” title=”<?php echo $title ?>”>
<?php echo $title ?></a> (<?php echo $commentcount ?>)</li>
<?php } } ?>
</ul>

Posted in Php Code, WordPress. Comments Off on How to add 10 hot wordpress posts »

How to control WordPress 9.2 tag cloud font size?

We all know that WP has added widget_tag_cloud_args filter, you can use this function to override the default arguments that are passed to the wp_tag_cloud function to change the tag cloud font size you like. This filter provides a keyed array, where the smallest, largest, and unit keys represent the smallest font size, the largest font size, and the unit (‘pt’, ‘em’, ‘px’, etc) used by the default tag cloud widget.
(more…)

Posted in WordPress. Comments Off on How to control WordPress 9.2 tag cloud font size? »

Add WordPress Category Description

Usually wordpress category description does not show even we add each wordpress category description at WP Administration Panel. Any method to show category description? Yes! Follow me:

Go to Appearance –> Editor, and click Category Template (category.php) .

 Add <div><strong><?php single_cat_title(‘Currently browsing’); ?>
</strong>: <?php echo category_description(); ?></div> 

at proper place. (more…)

Posted in WordPress. Comments Off on Add WordPress Category Description »

Add one adsens ads except homepage.

It is very simple, copy the following code, and change YOU ADSENSE ADS CODE HERE. to your ads code. done!

 <div class=”storycontent”>

<?php if (($wp_query->current_post == 0)and (!is_home())) : ?>
<div style=”float:right”><br>
YOU ADSENSE ADS CODE HERE.
</div>
<?php endif; $postcnt++; ?>
  <?php the_content(__(‘(more KINGPHP details…)’)); ?>
 </div>

Posted in Php Skills, WordPress. Comments Off on Add one adsens ads except homepage. »

WordPress Posts not indexing on Google

We are adding regular content everyday but for the past few weeks Google don’t seem to index the new posts at all.

Usually they were indexing within a few minutes.  At first I think their must be something wrong with my web hosting or SSL, so I changed the hosting from hostgator to dreamhost, same problem.  I search wordpress.org forum, and found that we have to set the folloing for our new wordpress now.

Log into WP and under Settings -> Privacy, make sure your WP isn’t blocking search engines.

At the same time,  check for a robots.txt file that is blocking bots,  get a Google account and use the Google Webmaster Tools to run a diagnostic on our site, and we will know what to do.

Posted in WordPress. Comments Off on WordPress Posts not indexing on Google »

Add adsense code after wordpress tag cloud

If we add <!–more–>, the content after will now show at homepage, and other categories. When visit the detailed post, the content after  <!–more–> will show.

 Now  I will teach you how to add adsense code within the function, that is to say, when we visit the detailed post, the adsense ads will show also, at other pages, it will not show.

 Go to wp-includes, open page-templates.php, search <span id=”more, and click the second results, at line 223, add your code within <span id=”more-‘ . $id . ‘”>Put your code here></span>

 Save and upload the page to your host.

Demo: www.wordpublish.com ,this site is on cartridges, and digital cameras.

Posted in WordPress. Comments Off on Add adsense code after wordpress tag cloud »

WordPress 2.8 Template Tags/wp tag cloud

Usage

Default Usage
‘smallest’ => 8,
‘largest’ => 22,
‘unit’ => ‘pt’,
‘number’ => 45,
‘format’ => ‘flat’,
‘orderby’ => ‘name’,
‘order’ => ‘ASC’,
‘exclude’ => ,
‘include’ => ,
‘link’ => ‘view’,
‘taxonomy’ => ‘post_tag’,
‘echo’ => true ); ?>

By default, the usage shows:

smallest – The smallest tag (lowest count) is shown at size 8
largest – The largest tag (highest count) is shown at size 22
unit – Describes ‘pt’ (point) as the font-size unit for the smallest and largest values
number – Displays at most 45 tags
format – Displays the tags in flat (separated by whitespace) style
orderby – Order the tags by name
order – Sort the tags in ASCENDING fashion
exclude – Exclude no tags
include – Include all tags
link – view
taxonomy – Use post tags for basis of cloud
echo – echo the results
Parameters
smallest
(integer) The text size of the tag with the smallest count value (units given by unit parameter).
largest
(integer) The text size of the tag with the highest count value (units given by the unit parameter).
unit
(string) Unit of measure as pertains to the smallest and largest values. This can be any CSS length value, e.g. pt, px, em, %; default is pt (points).
number
(integer) The number of actual tags to display in the cloud. (Use ‘0’ to display all tags.)
format (more…)

Posted in WordPress. Comments Off on WordPress 2.8 Template Tags/wp tag cloud »

wordpress ban ip plugin

WordPress ban ip pluginwill display a custom ban message when the banned IP, IP range, host name or referer url trys to visit you blog. You can also exclude certain IPs from being banned. There will be statistics recordered on how many times they attemp to visit your blog. It allows wildcard matching.

WordPress ban ip plugin will display a custom ban message when the banned IP, IP range, host name or referer url trys to visit you blog. You can also exclude certain IPs from being banned. There will be statistics recordered on how many times they attemp to visit your blog. It allows wildcard matching too.

Download:http://wordpress.org/extend/plugins/wp-ban/

Posted in WordPress. Comments Off on wordpress ban ip plugin »

Plugin for limit the size of the post in the main page in WordPress

The  plugin  for WordPress in order to control the maximum amount of characters displayed for an entry on the main page. If the set limit is surpassed a link to a page with the whole content will appear and the text on the entry will be chopped to that amount of characters, otherwise the content will be showed unchanged. (more…)

Posted in Php Code, WordPress. Comments Off on Plugin for limit the size of the post in the main page in WordPress »

Show post titles at category, and show your own words at homepage.

<?php get_header(); ?>

<?php if (is_home())

echo ”
Welcome, add your own words here!

“; ?>

<?php if (!is_home())

{ ?>
<ul>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<li>
<a href=”<?php echo get_permalink()?>”><?php the_title(); ?></a>
</li>
<?php endwhile; endif; ?>
<ul>

<?php }  ?>

<?php get_footer(); ?>

Posted in Php Skills, WordPress. Comments Off on Show post titles at category, and show your own words at homepage. »
King Php Science Welcome, you are from: 54.144.250.128