Archive

Posts Tagged ‘wordpress’

$ add adsense under each wordpress post by hand code $

October 12th, 2008 No comments

Sometimes I dont like to use plugin to add adsense in the blog, so I tried to add it by hand code, following is an example for add adsense under each post:

Go to the file of single.php in the theme fold, read and find the code for displaying the content, the <div class=”storycontent”> should be the code to display the content, and the <div class=”meta”> should be the code to show the post meta, so just add the script under the the post meta, I use the <hr> to isolate adsense for clearance.

<div class=”storycontent”>
<?php the_content(__(‘(more…)’)); ?>
</div><!– end storycontent –>

<div class=”meta”>

Written by <?php the_author() ?><?php _e(” in:”); ?> <?php the_category(‘,’) ?> | <?php the_tags(__(‘Tags: ‘), ‘, ‘, ‘ ‘); ?><?php edit_post_link(__(‘Edit This’)); ?>
<?php wp_link_pages(); ?><br />

</div><!– end meta –>

<hr>
******paste google adsense script here*************
<hr>

Related Blogs

$ Disable WordPress Auto-Saving and Revisions $

October 10th, 2008 No comments

Disable WordPress Auto-Saving
Open the WordPress Config File:

/wp-config.php

And add following code after the first set of functions :

define( ‘AUTOSAVE_INTERVAL’, 600 );

By Default this value is set to 60 (seconds), 600 equals 1 Hour,you can go higher, but i figure 1 hour is good for me.

Disable WordPress Revisions
Open the WordPress Config File:

/wp-config.php

And and following code after the first set of functions:

define( ‘WP_POST_REVISIONS’, 0 );

By Default this value is On (1), turn it off by setting it to Off (0) ( Zero ).

Related Blogs

Categories: wordpress Tags:

Change the amount of posts displayed at wordpress manage page

September 13th, 2008 No comments

only 15 posts will be displayed by default when try to manage posts at wordpress, sometimes there is a need to see more posts for bulk modification, following is a way:

go to the post.php in the folder of wp-admin/includes, and find the code:

wp(“post_type=post&what_to_show=posts$post_status_q&posts_per_page=15

&order=$order&orderby=$orderby”);

change the 15 to the desired number in posts_per_page=15.

Categories: wordpress Tags:

The code for the image link of wordpress

August 23rd, 2008 No comments

the code for the image link of wordpress:
<img src=”http://www.zzz.cn/111.png” />

Categories: wordpress Tags: ,

remove the dashboard in wordpress

August 10th, 2008 No comments

There are many rss in the dashboard, and sometimes it causes the wp-admin to load slowly, following is a way to remove the dashboard:

find and modify the file of index-extra.php in the folder \wp-admin:

original:

<?php require_once(’admin.php’);
require( ‘includes/dashboard.php’ );
require_once (ABSPATH . WPINC . ‘/rss.php’);

@header(’Content-Type: ‘ . get_option(’html_type’) . ‘; charset=’ . get_option(’blog_charset’));

switch ( $_GET[’jax’] ) {

case ‘incominglinks’ :
wp_dashboard_incoming_links_output();
break;

case ‘devnews’ :
wp_dashboard_rss_output( ‘dashboard_primary’ );
break;

case ‘planetnews’ :
wp_dashboard_secondary_output();
break;

case ‘plugins’ :
wp_dashboard_plugins_output();
break;

}

?>

modified:

<?php require_once(’admin.php’);
require( ‘includes/dashboard.php’ );
require_once (ABSPATH . WPINC . ‘/rss.php’);

@header(’Content-Type: ‘ . get_option(’html_type’) . ‘; charset=’ . get_option(’blog_charset’));
/*
switch ( $_GET[’jax’] ) {

case ‘incominglinks’ :
wp_dashboard_incoming_links_output();
break;

case ‘devnews’ :
wp_dashboard_rss_output( ‘dashboard_primary’ );
break;

case ‘planetnews’ :
wp_dashboard_secondary_output();
break;

case ‘plugins’ :
wp_dashboard_plugins_output();
break;

}
*/
?>

Categories: wordpress Tags: ,

Try to manipulate the wordpress2.5RC2

August 10th, 2008 No comments

Try to install and manipulate the wordpress2.5RC2,the new version is much slower than the version of 2.3.3, the Administration Screen is clean, no option for cache and gzip settings.

Try to export and import the databases by phpmyadmin.

Categories: wordpress Tags: