How to access fields values in functions.php
-
Hi
I am trying to use
pre_get_posts
to filter posts based on CFS field values.– I have posts with boolean field named
_is_a_video
– I want to usepre_get_posts
to limit posts only to the ones with TRUE value for_is_a_video
fieldThe problem is I don’t know how to access the field value in the function. How to make the following code works?
function limit_to_video_posts($query) { if ($query->is_author() AND $query->is_main_query()) { $query->set(.....); } } add_action('pre_get_posts', 'limit_to_video_posts');
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to access fields values in functions.php’ is closed to new replies.