• Resolved fredericv

    (@fredericv)


    Hi,

    I want to change the Custom Filter Layout, so :

    • I selected “Custom Layout” as “filter type” in the filter layout panel
    • In functions.php I wrote the full example wrote here then called : add_filter('ymc_filter_custom_layout_545_1', 'my_custom_filter_layout', 10, 6);

    But nothing happended : on my page I always get the message to write an add_filter("ymc/filter/layout/top/custom", "callback_function", 10, 5); hook. If I write this hook, for example :

    add_filter('ymc/filter/layout/top/custom_22941_1', function ($output, $filter_id, $taxonomies, $term_settings, $container_class) {

    $terms = '';

    foreach ($taxonomies as $taxonomy) {

    foreach ($term_settings[$taxonomy]['terms'] as $term_id => $term_info) {

    // For example, output all visible terms

    if ($term_info['term_visible']) {

    $terms .= "<div class=\"{$term_info['term_class']}\">{$term_info['term_name']}</div>";

    }

    }

    }

    return $terms;

    }, 10, 5);

    It works perfectly.

    Many thanks for your help !

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author YMC

    (@wssoffice21)

    Hi!
    You should use different documentation for the plugin 3.x.x:
    https://github.com/YMC-22/YMC-Filter#custom-post-layout
    This is old documentation that applies to the old version of the plugin (2x). The new version of the plugin should be 3.x.

    • This reply was modified 1 week, 1 day ago by YMC.
    Thread Starter fredericv

    (@fredericv)

    Ok, sorry 🙂

    Many thanks !

    Plugin Author YMC

    (@wssoffice21)

    Good luck!

    Thread Starter fredericv

    (@fredericv)

    Is there more doc on custom filter layout ? The example in old documentation was nice, because it showed JS script in the hook, and how to add events on clic.

    Plugin Author YMC

    (@wssoffice21)

    If you’re stuck with an older version of the plugin, you can switch to the older version (but it’s no longer supported). Therefore, it’s best to use the newest version. All documentation is available on GitHub and that’s it.

    Thread Starter fredericv

    (@fredericv)

    Ok, thanks

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.