Custom RSS feeds in WordPress
June 12, 2009
RSS feeds are very useful and very popular. WordPress creates RSS feeds by default, but how to create your own, custom RSS Feed? If you need a custom RSS feed, like for example, a feed indexing only somes categories and tags, or if you redirected all WordPress RSS feeds to Feedburner but still want to be able to get a category feed, there’s an easy solution though, just follow these steps: create a custom page template within your theme that serves out the feed (code below) create a new page (which can be blank),... [Read the full story]
get wordpress custom fields outside the loop
June 12, 2009
Custom fields are very useful and are used on many WordPress blogs. But how to easily get custom fields values outside the loop? To display a custom field value outside the loop, simply use the following code. Don’t forget to replace Myfield on line 4 by the name of the custom field you want to display. <?php global $wp_query; $postid = $wp_query->post->ID; echo get_post_meta($postid, 'MyField', true); ?> Read More →
create wordpress page template to redirect to first child page
June 9, 2009
Many WordPress users uses parent pages and subpages to order the informations displayed on their blogs. Then how to be able to redirect to the first child page if the current page have children pages? You have to create a wordpress page template to redirect to first child page, Create a new file and paste the following code in it: <?php /* Template Name: Redirect To First Child */ if (have_posts()) { while (have_posts()) { the_post(); $pagekids = get_pages("child_of=".$post->ID."&sort_column=menu_order"); ... [Read the full story]
hide specific wordpress sentence or text to Google robots
June 4, 2009
How to only hide a portion of text to Google, your navigation menu for example? Hiding a portion of text to Google is damn easy, but not everyone is aware of this method. Simply use the following html comments in your source files (or in WordPress editor, in html mode) to hide a specific sentence or text to Google robots. This text will be indexed by Google... <!--googleoff: all--> ...but not that one! <!--googleon: all> These tags tells Google that the text embeded within them should not be indexed. Of course,... [Read the full story]
Get rid of auto media enclosures on WordPress
June 2, 2009
When you’re adding a multimedia file as such as a mp3 or flv file, WordPress automatically create a custom field named enclosure and add the media url to your rss feed. Great for podcasters, but unusefull for most bloggers. Let’s see how to get rid of it. Just paste the following lines of codes within your functions.php file, and then, say goodby to automatic enclosures. function delete_enclosure(){ return ''; } add_filter( 'get_enclosed', 'delete_enclosure' ); add_filter( 'rss_enclosure', 'delete_enclosure' ); add_filter(... [Read the full story]




















