I have created a custom post-type called "event".
For this custom post-type I created an advanced custom field called "event_date".
Now I am trying to display the list of my events in a RSS feed.
I figured out how to display custom fields and featured image in my RSS feed but I cant figure out how to re-arrange the feed content according to the event_date and not the date when the post was created...
Can someone help me with a URL string query for RSS feed or a simple line I can add to my functions.php?
Thanks a lot in advance!
I have created a custom post-type called "event".
For this custom post-type I created an advanced custom field called "event_date".
Now I am trying to display the list of my events in a RSS feed.
I figured out how to display custom fields and featured image in my RSS feed but I cant figure out how to re-arrange the feed content according to the event_date and not the date when the post was created...
Can someone help me with a URL string query for RSS feed or a simple line I can add to my functions.php?
Thanks a lot in advance!
Share Improve this question asked Dec 3, 2019 at 5:22 Natalia DavydovaNatalia Davydova 111 bronze badge1 Answer
Reset to default 0hope this code will helpful for you
$args = array(
'post_type' =>'event',
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_key' => 'event_date',
'orderby' => 'meta_value_num',
'order' => 'DESC'
);