Navigation überspringen

[Gelöst] How can I add taxonomy terms to the Custom Post Type RSS feed?

This support ticket is created vor 5 Jahren, 11 Monaten. 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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Dieses Thema enthält 16 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von PaulS4783 vor 5 Jahren, 11 Monaten.

Assistiert von: Nigel.

Author
Artikel
#1207450

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

You are still echoing the metaValue but you should be echoing the metaDate.

#1207457

Yep. My mistake.
This code works now.
You can close the ticket.
Thanks!

//Adds custom fields to the RSS feed for Events
add_action('rss2_item', 'add_my_custom_field_node');
function add_my_custom_field_node() {
    global $post;
    $metaValue = get_post_meta($post->ID, 'wpcf-start-date', true);
    if(!empty($metaValue)):
        $metaDate = date("d M Y", $metaValue);
        echo("<start-date>{$metaDate}</start-date>");
    endif;
}