Documentation / Typical Problems

Typical Problems

Typical problems with AJAX, Chips list, Filters button, Auto scroll

If you have one of these problems:

  • AJAX feature doesn’t work properly
  • Button that opens Filters widget doesn’t appear (Please, read this)
  • Selected terms (aka Chips list) doesn’t appear above the posts container
  • Auto scroll to the top of the posts grid doesn’t work

you can try to to specify correct values that match your theme and place the code below to the functions.php file of your theme.
All values in the config array are optional and you can set only the ones you need.

add_filter( 'wpc_theme_dependencies', 'my_theme_dependencies' );
function my_theme_dependencies( $theme_dependencies ){

    /* my_theme_folder_name - name of the directory of your current WordPress
    theme. All letters should be lowercase even if the theme directory
    has uppercase letters. If you use child theme, you should specify
    parent theme name */

    $theme_dependencies['my_theme_folder_name'] = array(
        // HTML selector of the container included posts. E.g. '#primary' or
        // '.main-wrapper .posts'
        'posts_container'   => '#primary',
        // Primary color of your theme. E.g. '#ff0000'
        'primary_color'     => '#cc0000',
        // Array with names of the do_action() hooks of your theme, where you want
        // to display button, that opens Filters widget E.g. 'before_main_content'
        'button_hook'       => array('generate_before_main_content'),
        // Array with names of the do_action() hooks of your theme, where you want
        // to display chips. E.g. 'before_posts_list' 
        // Don't forget to add Chips list on the 404 page.
        'chips_hook'        => array(
                                    'generate_before_posts_list', 
                                    'generate_no_posts_found'
                               )
    );

    return $theme_dependencies;
}

Make your filtering best with