WordPress

A List of Nice WordPress Themes

No GoodNeed ImprovementOKGoodExcellent (No Ratings Yet)
Loading ... Loading ...

Popularity: 1%

Comments

WordPress: How to feed RSS with contents from another table (not wp_posts)

No GoodNeed ImprovementOKGoodExcellent (No Ratings Yet)
Loading ... Loading ...

If you want to make RSS to use data from another table, you need to edit the_excerpt_rss() function in wp-includes/feed.php file, change

$output = get_the_excerpt(true);

to something like this:

function the_excerpt_rss() {
// $output = get_the_excerpt(true);
global $wpdb, $post;
$postID = $post->ID;
$grants = $wpdb->get_results(”select abstract
from grants where post_id= $postID”);
$output=”";
foreach ($grants as $grant)
{
$output=$grant->abstract;
}

echo apply_filters('the_excerpt_rss', $output);
}

Or (the best way), write your own function like this:

function the_abstract_rss() {
global $wpdb, $post;
$postID = $post->ID;
$grants = $wpdb->get_results(”select abstract
from grants where post_id= $postID”);
$abs=”";
foreach ($grants as $grant)
{
$abs=$grant->abstract;
}
echo $abs;
}

then apply filter:

add_filter('the_excerpt_rss','the_abstract_rss');

Popularity: 1%

Comments

How to tune WordPress: Object Caching, Compression, Plugins, Full-text Search

No GoodNeed ImprovementOKGoodExcellent (No Ratings Yet)
Loading ... Loading ...

When you have 100,000 post in your blog site, your WordPress will be extremely slow. Here is how I made WordPress runs faster:

1, Edit your wp-config.php file, add the following line this line : define ('WPLANG', '');

define('ENABLE_CACHE', true);

2, Install wp-cache plugin, don’t forget to turn on caching after activating it.

3, Add the following two lines to your .htaccess file under web root directory (ref):

php_flag zlib.output_compression on
php_value zlib.output_compression_level 2

4, Remove all unnecessary plugins.

Popularity: 1%

Comments

« Previous Next »