it is local. 5.4. There are no js errors
@elliot I did. Whether I use 50 or 200 doesn’t matter. If I leave the function out (which means it is querying six thousand posts) it works just fine but anything I do to try to reduce that numbers breaks it
@elliot that the weird part. If I remove it then the search works. There are 6k posts on this site. Search handles them just fine without the above function.
function tdr_carousel_query( $args, $field, $post )
{
$args = array(
'posts_per_page' => 200
);
return $args;
}
add_filter('acf/fields/relationship/query', 'tdr_carousel_query', 10, 3);
no on screen errors. just when you start typing in the search box nothing happens. When I remove the above code it works just fine.
Production and local
I will as soon as I figure out how to do it myself 🙂
All you need to do it something like:
echo '<li>
' . get_the_title() . '
' .the_field('speaking_event_date') . '
</li>';
Just wanted to add another update. Here’s my function:`function m1_core_feature_selection() {
$include_albums = get_field('include_albums', 'option');
if ( $include_albums === true ){
include_once('lib/cpt_albums.php' );
}
}
add_action('after_setup_theme', 'm1_core_feature_selection');
`
When I do a var_dump($include_albums) I get bool(true). I can uncheck the box and see the change to bool(false). If I remove the if ( $include_albums === true ) piece from the function it works.
hey @unsalkorkmaz can you post some code that you have working w/ an options page in a functions.php file? I tried wp_head and that isn’t working for me either.
Hey Elliot. I wrote a function to go get some posts and their acf fields and the get_field worked just fine but for some reason it appears to not work with option pages
function m1_core_feature_selection() {
$include_albums = get_field('include_albums', 'option');
if($include_albums == 1) {
include_once('lib/cpt_albums.php');
}
}
add_action('init', 'm1_core_feature_selection', 20);
NO dice.
I’ve also included a couple of screen shots of my admin area
http://cl.ly/07142Z0r282F
after. I tried hooking into “init” as well and that didn’t work either.
Hey Elliot. I tried that and it still didn’t work. I pulled my include out of the function just to test and it works.
function m1_core_feature_selection() {
$include_albums = get_field('include_albums', 'option');
if($include_albums == 1) {
include_once('lib/cpt_albums.php');
}
}
add_action('wp_loaded', 'm1_core_feature_selection');
I also tried ‘init’ versus ‘wp_loaded’ and that didn’t work either
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.