Posts Tagged ‘manual’
tips dan trick rss pada wordpress
Publish The Feed Later
If you look at the possibilities of mySQL, there is a function timestampdiff(). I extend the query of WordPress with this function. Note to query the feed before (is_feed()), if not it will be also happening for the classical publishing of posts in your blog.
The following example publishs the post 5 minutes later in your feed:
/**
* puplish the content in the feed later
* $where ist default-var in WordPress (wp-includes/query.php)
* This function an a SQL-syntax
*/
function publish_later_on_feed($where) {
global $wpdb;
if ( is_feed() ) {
// timestamp in WP-format
$now = gmdate('Y-m-d H:i:s');
// value for wait; + device
$wait = '5'; // integer
// http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
$device = 'MINUTE'; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR
// add SQL-sytax to default $where
$where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
}
return $where;
}
add_filter('posts_where', 'publish_later_on_feed');
SUMBER
Redirecting WordPress Feeds to FeedBurner Feeds
The problem. Beginner bloggers usually start to use FeedBurner only after they have seen it used on many other blogs and realize how useful and cool this tool is. They sign up and start to use it, but their early readers are already subscribed to their default WordPress feed.
Another problem: do you often change your theme? If so, you must be bored having to edit each call to bloginfo(’rss2_url’) and replace it with your FeedBurner feed’s URL.
The solution. The solution to both problems described above is simple: use server redirections.
- Create a backup of your .htaccess file, located in the root of your Web server.
- Edit the .htaccess file and add the following code. Don’t forget to modify the feed’s URL with your own feed’s URL.
1# temp redirect wordpress content feeds to feedburner2<IfModule mod_rewrite.c>3RewriteEngine on4RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC]5RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]6RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/wprecipes [R=302,NC,L]7</IfModule> - Save the file. You’re done!
Code explanation. Each time someone clicks on a link to http://www.yourblog.com/feed, he or she will be redirected to http://feeds.feedburner.com/yourblog. This way, you will have never lost an RSS subscriber, and even if you change your theme twice a day, you’ll never have to manually edit your RSS feed links again.
Sources
- Redirect WordPress feeds to FeedBurner via htaccess (Redux)
- How to: redirect WordPress RSS feeds to FeedBurner with .htaccess
Insert Ads (or Anything Else) in Your RSS Feed
The problem. Monetizing RSS feeds is currently becoming a common practice, and many blog owners do it to maximize their income. FeedBurner can insert AdSense ads into your feed items, but you need at least 500 subscribers to qualify, and you can’t use any ads other than the AdSense ads provided by FeedBurner.
The solution. It is possible, though, to insert other kinds of ads into your RSS feed. You can, for example, use a link to a free WordPress theme only for your RSS subscribers.
Follow these simple steps to perform this hack:
- Edit the functions.php file of your theme. If your theme doesn’t have a functions.php file, simply create one.
- Paste the following code into your functions.php file:
1<?php2functioninsertAds($content) {3$content=$content.'<hr /><a href="http://www.wprecipes.com">Have you visited WpRecipes today?</a><hr />';4return$content;5}6add_filter('the_excerpt_rss','insertAds');7add_filter('the_content_rss','insertAds');8?> - Save the file. You’re now displaying your ads in your RSS feed!
Code explanation. I have seen many similar hacks on the Web, but all of them require you to edit WordPress core files to achieve the same result. Of course, editing WordPress core files is a very bad idea because then you would have to re-edit the files each time you upgrade your blog. Instead, this hack uses the add_filter() WordPress function to insert content into your RSS feed without editing any core files.
Sources
Format Your Images for Feed Readers
The problem. You took a lot of time to write and format your post and add beautiful screenshots. It looks so good on your blog. Sadly, when the post is displayed in Google Reader or any other RSS reader, it doesn’t look so great.
The solution. This is due to the fact that most feed readers display images inline with text:

To avoid this problem, add a CSS class to display the image as a block. WordPress provides the built-in class “center“:
Sources
Provide Your Readers with a Feed for Each Post
The problem. When a post has lots and lots of comments, it can be hard for readers to follow the conversation. Most WordPress users don’t know this, but our favorite blogging engine has a built-in function for providing an RSS feed for the comments in each post.The solution. Well, this recipe isn’t really a hack or anything: to provide an RSS feed for the comments in a particular post, just call the comment_rss_link() function:
Sources
Exclude Categories from Your RSS Feed
The problem. Do you use one of your blog categories to let readers know about your website’s news, or does your blog feature a category that has nothing to do with the rest of your content? If so, it is generally not a good idea to include it in your RSS feed.
The solution. Here’s how to get rid of one of the categories in your RSS feed:
- First, get the numeric ID of the category you want to exclude. If you don’t know how to get the ID of a particular category, you can learn how here.
- Once you have the ID of the category you want to exclude from your RSS feed, edit the functions.php file in your theme. Create the file if it doesn’t exist.
- Paste the following code in it:
- Save the file, and you’re done!
Code explanation. This hack works exactly the same way as the previous one: create a custom function to exclude the category that you don’t want to appear in your RSS feed, and then use the super-useful add_filter() function to apply it to the pre_get_posts() WordPress core function.
Sources
Display Any RSS Feed on Your WordPress Blog
The problem. Do you have more than one blog, or do you manage a forum? If so, you may want to be able to display any RSS feed on your WordPress blog.
The solution. Many plug-ins can do the job, but they’re not necessary at all. WordPress has a built-in RSS reader that is used, for example, to display news on your dashboard. All you have to do is use it in your theme.
- Paste the following code anywhere in your theme (personally, I’d put it in the sidebar, the footer or, even better, the page template):
1<?phpinclude_once(ABSPATH.WPINC.'/rss.php');2wp_rss('http://feeds.feedburner.com/wprecipes', 3); ?> - Save it and you’re done. It’s as easy as that!
Code explanation. The first thing we have done is include the rss.php file from WordPress core. This file allows us to use the wp_rss() function, which takes two parameters: the first is the RSS feed’s URL, and the second is the number of RSS entries to be displayed.
Sources
Use Category-Specific RSS Feeds
The problem. Many blogs talk about a lot of different topics: design, programming, blogging tips, etc. Have you ever come across a blog in which you have enjoyed only one category of posts? If so, you should definitely consider offering one feed per category to your own readers.
The solution. Let’s say you’d like to be able to subscribe only to TheGridSystem’s tools section. The category URL is:
1 |
http://www.thegridsystem.org/categories/tools/ |
To get an RSS feed for this category, you simply have to add /feed to the end of the URL:
1 |
http://www.thegridsystem.org/categories/tools/feed |
Pretty easy, isn’t it? But pretty useful, too, in my opinion.
List RSS Feeds by Category

The problem. If you like the previous hack, you will probably also want to be able to display the names of all your category feeds in a list to your readers.
The solution.
- Edit any of your theme files, where you want to list your categories and their accompanying feeds.
- Paste the following code:
1<?php wp_list_categories('feed_image=http://www.myblog.com/image.gif&feed=XML Feed&optioncount=1&children=0'); ?> - Save the file. You categories will now be displayed, along with their RSS feeds!
Code explanation. This hack uses only the good old wp_list_categories() function, with two parameters. The first is feed_image, which allows us to specify the URL to be displayed as a feed image. The second parameter is feed, which is used to specify the feed format.
Get Rid of RSS Feeds the Clean Way

The problem. Let’s say you’re using WordPress as a CMS to manage your online portfolio or your company’s website. In such cases, the RSS feed isn’t that useful, and some people would probably want to remove it.
The solution. I have seen many “hacks” on the Web where people say you just have to remove the include on the wp-settings.php core file. I don’t think you should ever edit a core file. Instead, the following hack will do the job. Simply paste this code in the functions.php file of your theme:
1 |
function fb_disable_feed() { |
2 |
wp_die( __('No feed available,please visit our <a href="'. get_bloginfo('url') .'">homepage</a>!') ); |
3 |
} |
4 |
5 |
add_action('do_feed', 'fb_disable_feed', 1); |
6 |
add_action('do_feed_rdf', 'fb_disable_feed', 1); |
7 |
add_action('do_feed_rss', 'fb_disable_feed', 1); |
8 |
add_action('do_feed_rss2', 'fb_disable_feed', 1); |
9 |
add_action('do_feed_atom', 'fb_disable_feed', 1); |
Sources
Upload Joomla ke Acoount Hosting secara manual
Ada tiga proses yang harus dilakukan untuk memidahkan joomla ke account hosting anda:
1. upload file web joomla anda ke hosting account anda.
2. export (dump) mysql database anda lalu create database baru di account hosting anda dan import database anda.
3. ubah setting konfigurasi joomla
Upload File
Karena joomla memiliki 1000 lebih file untuk diupload ke hosting account anda,lebih baik anda menkompress dahulu semua file tersebut dalam file .zip atau .tar.gz
* upload file kompres anda ke public_html.
* klik di nama file (jangan di iconnya) untuk pilih file .tar.gz or .zip yang telah anda upload
* klik menu Extract, maka secara otomatis file anda akan di extract.
* ubah permision file dan folder anda menjadi 755
Buat database dan import database
Untuk mengcreate database dan upload database melalui cpanel dan phpmyadmin silahkan lihat disini
Modifikasi konfigurasi file
Proses terakhir atau langkah terakhir dalam memindahkan web joomla anda ke account hosting anda adalah memodifikasi konfigurasi setting. Anda harus mengubah configuration.php yanga da dalam joomla, proses editing bisa dilalkukan di tect editor atau modifikasi file dalam cpanel lalu pilih nama file configuration.php lalu klik “code editor/edit“. dibawah ini adalah contoh konfigurasi apa saja yang butuh dirubah:
$mosConfig_MetaAuthor = ‘1?;
$mosConfig_MetaDesc = ‘Joomla – the dynamic portal engine and content management system’;
$mosConfig_MetaKeys = ‘Joomla, joomla’;
$mosConfig_MetaTitle = ‘1?;
$mosConfig_absolute_path = ‘/home/user/public_html/’; * ubah sesuai path account server anda (ganti user sesuai dengan username di account hosting anda) $mosConfig_admin_expired = ‘1?;
$mosConfig_allowUserRegistration = ‘1?;
$mosConfig_back_button = ‘1?;
$mosConfig_cachepath = ‘/home/user/public_html/cache’; * ubah sesuai path di account hosting anda
$mosConfig_cachetime = ‘900?;
$mosConfig_caching = ‘0?;
$mosConfig_db = ‘dbname’; * Ini adalah nama database yang anda create
$mosConfig_dbprefix = ‘jos_’;
$mosConfig_debug = ‘0?;
$mosConfig_dirperms = ”;
$mosConfig_editor = ‘tinymce’;
$mosConfig_enable_log_items = ‘0?;
$mosConfig_enable_log_searches = ‘0?;
$mosConfig_enable_stats = ‘0?;
$mosConfig_error_message = ‘This site is temporarily unavailable.
Please notify the System Administrator’;
$mosConfig_error_reporting = ‘-1?;
$mosConfig_favicon = ‘favicon.ico’;
$mosConfig_fileperms = ”;
$mosConfig_fromname = ”;
$mosConfig_frontend_login = ‘1?;
$mosConfig_frontend_userparams = ‘1?;
$mosConfig_gzip = ‘0?;
$mosConfig_helpurl = ‘http://help.joomla.org’;
$mosConfig_hideAuthor = ‘0?;
$mosConfig_hideCreateDate = ‘0?;
$mosConfig_hideEmail = ‘0?;
$mosConfig_hideModifyDate = ‘0?;
$mosConfig_hidePdf = ‘0?;
$mosConfig_hidePrint = ‘0?;
$mosConfig_hits = ‘1?;
$mosConfig_host = ‘localhost’;
$mosConfig_icons = ‘1?;
$mosConfig_item_navigation = ‘1?;
$mosConfig_lang = ‘english’;
$mosConfig_lifetime = ‘900?;
$mosConfig_link_titles = ‘0?;
$mosConfig_list_limit = ‘30?;
$mosConfig_live_site = ‘http://yourdomain.com; * Ini adalah URL web joomla site anda
$mosConfig_locale = ‘en_GB’;
$mosConfig_mailer = ‘mail’;
$mosConfig_mailfrom = ‘ you@yourdomain.comThis e-mail address is being protected from spam bots, you need JavaScript enabled to view it ;
$mosConfig_multilingual_support = ‘0?;
$mosConfig_multipage_toc = ‘1?;
$mosConfig_offline = ‘0?;
$mosConfig_offline_message = ‘This site is down for maintenance.
Please check back again soon.’;
$mosConfig_offset = ‘-10?;
$mosConfig_offset_user = ‘0?;
$mosConfig_pagetitles = ‘1?;
$mosConfig_password = ‘password’; * Ini adalah password user database anda yang telah anda buat
$mosConfig_readmore = ‘1?;
$mosConfig_secret = ‘qYwasdloRtdEwsa’;
$mosConfig_sef = ‘0?;
$mosConfig_sendmail = ‘/usr/sbin/sendmail’;
$mosConfig_session_life_admin = ‘1800?;
$mosConfig_session_type = ‘0?;
$mosConfig_shownoauth = ‘0?;
$mosConfig_sitename = ‘My Joomla Site’;
$mosConfig_smtpauth = ‘0?;
$mosConfig_smtphost = ‘localhost’;
$mosConfig_smtppass = ”;
$mosConfig_smtpuser = ”;
$mosConfig_uniquemail = ‘1?;
$mosConfig_user = ‘dbuser’; * Ini adalah user database yang telah anda create
$mosConfig_useractivation = ‘1?;
$mosConfig_vote = ‘0?;
setlocale (LC_TIME, $mosConfig_locale);
?>
Setelah selesai melakukan perubahan setting silahkan save changes
Copas dari SINI
