Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi,

    please, can you post me the code you use ?

    Thread Starter motofusion

    (@motofusion)

    I used
    <?php the_widget( 'yith-woo-ajax-navigation-3', 'dropdown', 'abc' ); ?>

    yith-woo-ajax-navigation-3: name got from chrome’s inspect element
    ‘abc’ is attribute type that I want to filter
    I need dropdown filter with OR parameter

    I also tried the following, but to same result:
    <?php the_widget( 'yith-woo-ajax-navigation', 'dropdown', 'abc' ); ?>

    Plugin Author YITHEMES

    (@yithemes)

    Hi,

    This code are wrong because the correct syntax is:

    <?php the_widget( $widget, $instance, $args ); ?>

    Where…

    $widget is the widget class name

    $instance The widget’s instance settings

    $args the argument for the widget class

    this is the way it works, so in your case you can:

    <?php
    $instance = array(
        'title' 		= "Your Widget Title",
        'attribute' 	= 'abc',
        'query_type'	= 'or',
        'type'		= 'select'
        'display' 		= 'all'
    );
    
    the_widget( 'YITH_WCAN_Navigation_Widget', $instance );
    ?>

    As you can see is a bit more complex than you thought …

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Call Widget in php’ is closed to new replies.