Home › Forums › General Issues › Parameters in url: array returns bool (false) › Reply To: Parameters in url: array returns bool (false)
Hi @michstar
In this case, I suggest you stick with the example instead. So instead of modifying the structure, you can try to move the code to a function like this:
function filter_herenschoenen() {
foreach( $GLOBALS['my_query_filters'] as $key => $name ):
// get the field's settings without attempting to load a value
$field = get_field_object($key, false, false);
// set value if available
if( isset($_GET[ $name ]) ) {
$field['value'] = explode(',', $_GET[ $name ]);
}
// create filter
?>
<div class="filter" data-filter="<?php echo $name; ?>">
<?php create_field( $field ); ?>
</div>
<?php endforeach;
}
Also, could you please share the JSON or XML export file of your field group, your functions.php file and your archive.php/category.php file? If the code is too long, you can use https://gist.github.com/.
Thanks 🙂
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.