Saltar navegación

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

This support ticket is created hace 5 años, 10 meses. 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)

Etiquetado: 

Este tema contiene 16 respuestas, tiene 2 mensajes.

Última actualización por PaulS4783 hace 5 años, 10 meses.

Asistido por: Nigel.

Autor
Mensajes
#1207450

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: 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;
}