Syndicating custom fields in Wordpress via RSS -


I wonder if I can ask a Wordpress / RSS question, I can not find any answers here. could have,

is trying to syndicate posts via RSS in Wordpress using the FeedWordpress plugin as an RSS aggregator, which includes five custom fields for each post in the original blog Your theme performance (original and syndicated / subscribe to the same subject) Industry are important for the receiving blog).

The original RSS these custom fields in 2 feeds as no different from an enclosure, which is defined in the default RSS feed template (act WP rss_enclosure).

It is written in the original feed:

     

RSS to add the rest of modifying 2-Feedkpeepeepi template, so they can show at the end of each segment in the current RSS feed 2, so for example they Included: ...

However, if I'd update syndicated post, or delete posts and receives modified feed again with Feedwardpres am not in any syndicated of these posts Shows

Is there a way to include these custom areas, so they are recognized by feedwordpress?

Basically all of your custom fields will have to syndicate the same format as the post.

Many thanks

Carlos

is a thread that covers it:

I enclose the answers in order to thank the subsequent improvements (Thanks Mikechankel, Sunderbomp and Actuve 7).

Add it to the functions of your subject. You must add namespace * / add_action ('rss2_ns', 'my_rss2_ns') to decide as Php:

  / *; Function my_rss2_ns () {echo 'xmlns: mycustomfields = "' get_bloginfo ('wpurl'). '' ''." \ N ";} 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 = get_the_ID (); ($ field as $ field) if ($ value = get_post_meta ($ post_id, $ field, true)) echo "& my; Mycustomfields: {$ field} & gt; {$ Value} & lt; / Mycustomfields: {$ field} & gt; ; \ N ";}}   

This will add all custom field names and values ​​to the main feed of the site.

Note, for custom fields with multiple values a modification is necessary because these will only work for a single-value fields, not arrays.

so,

  1. on the master site (where you are fROM Syndicate ) You add the above function.
  2. On the Slave site (where you are syndicated), suppose you have FeedWordPress inst Go to "Syndication" -> Click
  3. Name the RSS feed
  4. Go to Custom Feed Settings and plug it in pieces

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -