Skip Navigation

[Resolved] Customize rss feed

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to customize my site's RSS feeds.

Solution: Types does not offer a way to directly modify RSS feed information through the wp-admin area, but another ticket here on the forum includes some information about customizing RSS feeds you might find helpful.

You can access raw custom field values in PHP using the following syntax:

get_post_meta( $post_id, 'wpcf-fieldslug', true);

Or you can access the formatted field values using this syntax:

types_render_field('fieldslug', array( "id"=>$post_id, "arg1"=>"some value") );

Relevant Documentation: https://toolset.com/forums/topic/how-to-get-an-rss-feed-from-custom-post-type-with-all-associated-fields-and-taxo/
https://toolset.com/documentation/customizing-sites-using-php/functions/
https://codex.wordpress.org/Customizing_Feeds

This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 5.05 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 6 replies, has 2 voices.

Last updated by coetzeeG 6 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#616229

I am reaching a point now where I need to pull the classifieds listing posts and display them on another WordPress site.

Can anyone provide me with a possible solution that will enable me to generate an rss feed that contains the post title, featured image and price?

#616304

I forgot to add something.

Even though there is a listing feed, see: hidden link

There is all kinds of information in there I do not need, so I'm looking for a solution to clean it up a bit and only pull certain fields.

#616395

Hi, Types does not offer a way to directly modify RSS feed information through the wp-admin area, but another ticket here on the forum includes some information about customizing RSS feeds you might find helpful:
https://toolset.com/forums/topic/how-to-get-an-rss-feed-from-custom-post-type-with-all-associated-fields-and-taxo/

You can access raw custom field values in PHP using the following syntax:

get_post_meta( $post_id, 'wpcf-fieldslug', true);

Or you can access the formatted field values using this syntax:

types_render_field('fieldslug', array( "id"=>$post_id, "arg1"=>"some value") );

More info about that API here:
https://toolset.com/documentation/customizing-sites-using-php/functions/

Here's the WordPress documentation for fully customizing your site's RSS feed templates, how to remove unwanted information, etc:
https://codex.wordpress.org/Customizing_Feeds

If you have specific questions about how to access information from Types fields, I'll be glad to answer any for you here. If this seems beyond the scope of your own coding abilities, we also have a portal where you can connect with professional developers: https://toolset.com/contractors

#616653

Thanks very much Christian,

Got thing to a point where I was able to create a rss2 feed without all the fluff.

One thing I'm still battling is actually displaying the listing price.

My idea was to display the price next to the title like this:

<title><?php the_title_rss() ?> - <?php get_post_meta( $post_id, 'wpcf-fieldslug', true); ?></title>

But there is no actual output of the price, any suggestions?

#616659

Sorry, I forgot to ad that I did replace fieldslug with price.

#617160

The function the_title_rss() retrieves data and outputs it, which is why that part works. The get_post_meta function will retrieve data, but not write it. So use echo to write out that information:

<?php echo get_post_meta( $post_id, 'wpcf-fieldslug', true); ?>
#617382

Sorted 🙂

Thanks very much