NPE Advanced Custom Fields date arguments not working
-
I am working on an “upcoming events” page. Eventually, I want my list to show:
- linked post title
- ACF site option field
nn_cityname
- ACF field
event_date
These two ACF date arguments work as expected:
include_acf_fields=‘event_date’
acf_date_format=‘Y-m-d’
exclude_all_past_events='event_date'
results in an empty container:
<div class="netsposts-menu"></div>
order_post_by_acf_date='event_date'
results in the error:
Undefined offset: 1 in /nas/content/live/nnalphastaging/wp-content/plugins/network-posts-extended/network-posts-extended.php on line 282
For the moment I am using
order_post_by='date_order desc'
on my test page to get some kind of sorting order.For #2 above, I realize that
include_acf_fields='nn_cityname'
gets nothing becausenn_cityname
is a site option field. ACF would get it using an extra parameter, i.e.,the_field('nn_cityname', 'option');
. Is there a way to do this other than writing a function for the subsites’ theme that copies the site option value to each post? Alternatively I might try to write a custom excerpt function for the subsites’ theme that captures my site option field. Any suggestions?It would be nice if NPE could limit results to posts which include an ACF value, but I am working around this with
days='365'
to limit the number of posts that can be called. (Many of the subsites are c. 10 years old and may have c. 100 posts each. Future “event” category posts on the subsites will include the ACFevent_date
field, but legacy posts generally won’t.)Many thanks for the plugin!
The page I need help with: [log in to see the link]
- The topic ‘NPE Advanced Custom Fields date arguments not working’ is closed to new replies.