Home › Forums › General Issues › How do I get PHP function to affect what’s displayed on my page? › Reply To: How do I get PHP function to affect what’s displayed on my page?
ACF does not work directly with page builders.
For elementor you either need to get the pro version that has ACF integration for most fields, use the ACF shortcode for simple fields or build your own shortcode for complex fields.
Something like a pre_get_posts query should work as usual placed in your functions.php file.
This part of your code looks to be incorrect
$query->query_vars['post_type'] == 'Staff Member'
You need to post type name there, not the label.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.