Tag Info

Hot answers tagged

9

Hi @curtismchale: Piggybacking off @prettyboymp's excellent answer,with my spin on it, here's how you can do multiple custom fields (I did 3, you can do more): add_action('rss2_item', 'yoursite_rss2_item'); function yoursite_rss2_item() { if (get_post_type()=='my_custom_post_type') { $fields = array( 'field1', 'field2', 'field3' ); $post_id = ...


7

function add_custom_fields_to_rss() { if(get_post_type() == 'my_custom_post_type' && $my_meta_value = get_post_meta(get_the_ID(), 'my_meta_key', true)) { ?> <my_meta_value><?php echo $my_meta_value ?></my_meta_value> <?php } } add_action('rss2_item', 'add_custom_fields_to_rss'); You should be ...


7

Without knowing what your post_gallery filter function does, there's no way to give a proper answer. However, if you are using the post_gallery filter, and returning new markup, then yes, it will be used in feeds too. The code you mention commenting out happens after the post_gallery filter, and won't get executed at all if you're returning a different ...


7

You should be able to use pre_get_posts and set the posts_per_page to 50 conditionally (on being feed for categories). Unfortunately there is this unresolved trac ticket. The only work-around is to do hook into post_limits and replace the LIMIT part of the SQL query directly. add_action('post_limits','wpse71759_category_rss_limit',10,2); function ...


6

WordPress bundles and wraps SimplePie class for feed download, caching and processing. Retrieving namespaced data with it would be something like this: $feed = fetch_feed( 'http://www.wdcdn.net/rss/presentation/library/client/iowa/id/128b053b916ea1f7f20233e8a26bc45d' ); $items = $feed->get_items(); foreach ( $items as $item ) { $credit = ...


5

RSS2 is the modernized version of the legacy format, atom is a more recent competing format. Both are read by all commonly used feed parsers. You'll run into a fanboy here and there that will try to convince you that one is better than the other. In reality it makes no difference whatsoever. Use the default. Or toss a coin to pick one.


5

A long time ago WordPress did not put feed links into the head element automatically. Theme or plugin authors had to do that. In 2009 automatic_feed_links() was introduced, a function that should be used in themes or plugins to let WordPress do the hard work. One year later it was added to Twenty Ten, and it became a de facto standard. Not much later ...


4

Simple answer is yes you can. :) First check out Wordpress's codex here on their RSS feeds. http://codex.wordpress.org/WordPress_Feeds Then what you can do is change the default head rss links that let browsers know that there is an RSS feed. In your theme find: <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo ...


4

I'll take another shot. The following should modify the main query, such that it will include in its loop any posts that belong to no term of the Edition custom taxonomy. add_filter('pre_get_posts','better_editions_archive'); function better_editions_archive( $query ) { if ( $query->is_tax( 'edition' ) && $query->is_main_query() ) { ...


3

Tricky. It lumps categories and tags together pretty good. Had couple of approaches here is least messy: add_filter('the_category_rss', 'remove_rss_categories'); function remove_rss_categories( $the_list ) { $categories = get_the_category(); foreach ($categories as $category) $the_list = ...


3

Here are some reasons I think FB does well: feed statistics: subscribers, item view and clicks email subscription: control email template, subscribers sharing posts on social networks with FeedFlare monitize with Google Adsense reduces CPU usage on your host. Some of above features you can do with plugins, but it costs CPU usage and sometimes host space. ...


3

Yes. The fact of the matter is that people will want to use both for different reasons. Google, for example, converts all RSS feeds to Atom before using them in Google Reader. WordPress, for example, can only read RSS feeds in its built-in feed readers (try importing a Google-ified feed into WordPress and everything breaks!). But which style you use is a ...


3

You can, but you shouldn't. RSS feeds are built in XML. Not in HTML. Links in XML don't have meaning because they're HTML elements. However, because XML can be read by most HTML parsers (i.e. web browsers), you can easily mistake an XML document for an HTML one (the prevalence of XHTML helps to blur this line even further). In reality, though, no one ...


3

Feed templates are special case. You can't simply provide your own template - you need to work with do_feed_ hooks to change handler function. But for your specific question it is much easier to override author. Try this (not tested): add_filter( 'the_author', 'feed_author' ); function feed_author($name) { if( is_feed() ) return 'Acme, Inc.'; ...


3

Full Text Feed plugin shows full content....follow the installation steps there,and then goto settings->Reading->For each article in a feed, show=>select Full text and save.it'll work.if you want to implement via the code means, <?php if (get_option('rss_use_excerpt')) : ?> <description><![CDATA[<?php the_excerpt_rss() ...


3

There are three simple steps to get what you want: Hook into 'template_redirect' to act before the feed is displayed. If it is a feed send a 404 status header and load the 404 template. Here is a simple plugin that does it: <?php # -*- coding: utf-8 -*- /** * Plugin Name: T5 404 Feed * Description: Sends a 404 status code for all feeds and loads ...


3

You have add_feed('feedname', 'my_feed'); but no my_feed function to actually generate the feed output. Create a my_feed function and have it call the template to generate the feed output. Like this: function my_feed() { include 'path-to-that-template-file.php'; } add_feed('feedname','my_feed'); Then regenerate your permalinks, one time only, by ...


3

To make the choice for users as simple as possible, I recommend using only one feed link. Even I am always confused when having to choose between RSS, RSS 2.0 and Atom. Are there still readers out there that don't understand all three different formats? Whether it links to FeedBurner or not depends on your personal preferences. FeedBurner has advantages: it ...


3

I'm mobile, so this will be short. Use the after_setup_theme hook to add a function to set those variables. Declare them as global inside that function before setting them. Hope that helps. If anybody wants to add an example to this answer before I get home, feel free. ;)


3

Authenticator, a plugin on github https://github.com/bueltge/Authenticator uses HTTP Auth by default to get the functionality equivalent to Members Only. It also has the ability to create a token to work the same way Feed Keys work.


3

The problem will likely be a (very slow) callback that is attached to your get_the_excerpt() function. To inspect the attached callbacks, just inspect the global: // Best hooked to `shutdown` echo '<pre>'.var_export( $GLOBALS['wp_filters']['get_the_excerpt'], true ).'</pre>'; Then get rid of all those callbacks.


2

Things that present headlines in a horizontal scroll tend to be called tickers. (Probably due to there resemblance to old-school ticker tape printers.) Anyway, try these: http://wordpress.org/extend/plugins/news-ticker/ http://wordpress.org/extend/plugins/wordpress-news-ticker-plugin/ (may not do RSS) ...


2

Cron is job scheduling mechanism in Unix-based operating systems. It depends on your hosting if you have access to it. Since WordPress needs to run some tasks periodically it has own PHP-based mechanism called WP-Cron that is both used by core and accessible to plugins. Basically OS cron is more reliable, WP-Cron is more compatible. Automatic updates most ...


2

You can use the wp_meta hook: function extend_meta() { echo '<li><a href="' . get_bloginfo('atom_url') . '" title="' . esc_attr( __( 'Syndicate this site using Atom' ) ) . '">' . __('Entries Atom Feed') . '</a></li>'; } add_action( 'wp_meta', 'extend_meta' );


2

Okay, thanks to all who contributed to answering my question, but I had finally figured out the solution to my problem. Sorry for being naive but it turned out that I had a template_redirect action added to direct anything that's related to my post types to their respective template files. Something like this: function my_template_redirect() { global ...


2

add the small example function: add_action( 'request', 'fb_add_to_feed' ); // add to post-feed function fb_add_to_feed($request) { if ( isset($request['feed']) && !isset($request['post_type']) ) { $request['post_type'] = get_post_types( $args = array( 'public' => true, ...


2

You could choose to show the summary (excerpt) in the feed and adding this to your theme's functions.php: <?php function moreFeedlink($content) { $content = $content.'<div><a href="'.the_permalink().'">Read More</a></div>'; return $content; } add_filter('the_excerpt_rss', 'moreFeedlink'); ?>


2

If you're talking about subscribing to a page's wall (not notifications feed), then yes, you can do that. To find the feed for the wall, the easiest thing is to visit the target Facebook page in Firefox. Click the RSS icon in the address bar and choose "Subscribe to THE PAGE NAME". This will bring you to the actual feed. Copy the URL of the feed, and set it ...


2

THANK YOU THANK YOU for this excellent piece of information. I wanted to extend what the other two have written already... For this to validate, you must have a custom namespace. Here's how you do that: /* IN ORDER TO VALIDATE you must add namespace */ add_action('rss2_ns', 'my_rss2_ns'); function my_rss2_ns(){ echo 'xmlns:mycustomfields="'. ...


2

If your question is more like "which format is most widely used and supported?", then I got a pretty good answer for you: I analyzed the world's 50 most read blogs according to Technorati, and found that 9 (18%) offered Atom feeds while 48 (96%) offered RSS feeds. I've also never heard about a feed reader that doesn't support RSS (although I haven't tried ...



Only top voted, non community-wiki answers of a minimum length are eligible