Support

Account

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 🙂