Tag Info

Hot answers tagged

10

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 = ...


8

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 ...


8

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 ...


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

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() ) { ...


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 = ...


6

First step: remove the feed links from the section of your site. <?php add_action( 'wp_head', 'wpse33072_wp_head', 1 ); /** * Remove feed links from wp_head */ function wpse33072_wp_head() { remove_action( 'wp_head', 'feed_links', 2 ); remove_action( 'wp_head', 'feed_links_extra', 3 ); } Next up, let's remove the feed endpoints from WP. ...


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 ...


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.


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

Feeds are not stored, WordPress generate them on request. That means that even if WordPress can generate 4 type of feed, that does not affect in any way performance, but gives the possibility to users to choose a format they like according to reader they are using: is not WordPress fault if there are different types of feed standard. The WordPress preferred ...


3

The various versions of RSS contain increasingly complex information, with the RSS 2.* being the most up to date. Atom feeds are another competing method of syndicating content. In general, RSS Feeds are more commonly used, and are almost always used to distribute podcasts. The Wikipedia article gives pretty good info. http://en.wikipedia.org/wiki/Rss


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.


3

Very, very quick unscientific research suggests that there is only one query_var set for the main feed. Other feeds such as category, tag, author feeds have more than one query_var. Thus the following should kill the main feed but leave others intact. add_filter( 'pre_get_posts', function($qry) { if ($qry->is_feed()) { $fvars = ...


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

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

The AJAX request would query for the dates it requires to display. With Lazy fetching set, if you switch from month to week or day views it won't bother making another request, since it doesn't need to. This is outlined in the fullcalendar documentation. As for using this method, see this question on how to obtain the admin-ajax.php url properly. Next, you ...


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

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

The code you posted will do exactly what it says it will - prevent anyone from accessing your site via an RSS feed. Still there is tons of transient options.. like _transient_feed_mod or _transient_timeout_feed_mod These transient options have absolutely nothing to do with your site feed. The WordPress dashboard consumes several feeds by default and ...


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

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

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

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

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 ...


2

You can call wp_update_term_count_now( $terms, $taxonomy ) to update the term count for the specified terms (you will need to pass an array of all terms if you want to update them all). If you want to use your own function instead of the standard function (which counts all posts), you can set the update_count_callback of the taxonomy. The function you ...


2

Dunno if you have images in your feed, but those could be sucking up a bit of space: Reducing image size in RSS only Here are the basics for setting WP to use a custom feed template: http://www.456bereastreet.com/archive/201103/controlling_and_customising_rss_feeds_in_wordpress/ Here are some tips in authoring the template itself: ...


2

Something like this will add a /feed/special to your site. add_feed('special','do_special_feed'); function do_special_feed() { query_posts(array( 'meta_key' => 'key', 'meta_value' => 'value', )); do_feed_rss2(false); } After putting it in a plugin or your theme's functions.php or what have you, you'll need to visit the ...



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