• Resolved jdearingneudesic

    (@jdearingneudesic)


    I’d like to add a button between all the filters and the “reset” button inside the <div container="woof"></div> I don’t see any actions or filters I can call in my own theme or plugin to do that. Can I just implement a custom WOODF template or something?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author RealMag777

    (@realmag777)

    Hello

    You can do next: <div container="woof"><?php echo do_shortcode('woof') ?></div>

    Thread Starter jdearingneudesic

    (@jdearingneudesic)

    @realmag777 so you are suggesting I do that in a template file as opposed to in wp_posts.post_content?

    Plugin Author RealMag777

    (@realmag777)

    If you want to place in text editor you can create your shortcode wrapper, for example woof_custom

    Example:

    function add_shortcode( 'woof_custom', function($args){
    
       echo '<div class="woof-container">'.do_shortcode('[woof]').'</div>';
    
    });
    • This reply was modified 2 years, 7 months ago by RealMag777.
    Thread Starter jdearingneudesic

    (@jdearingneudesic)

    I ended up finding a slightly more elegant solution

    add_action('woof_after_draw_filter', function($key, $shortcode_atts) {
        // This is the last button WOOF generates.
        if($key === 'pa_portal') {
            echo 'my div';
        }
    }, 99, 2);
    

    That if statement depends on my custom taxonomy setup, but I could extend that in the future to let me either figure out the order of the woo commerce filters by a database query or even make it so I can configure the position with my own wp_options setting.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding a button within the filters container’ is closed to new replies.