Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #25125

    I’d like to enclose the Portfolio search (category) tags in a toggle as there may be as many as 30 tags, so it will keep the look tidy. I’ve tried adding do_shortcode to the loop-portfolio.php, but cannot get it to work.

    If I do this, will the search tags still work when the toggle is opened?

    Thanks

    Gary

    #125848

    Hi Gary,

    You’ll need to use the raw html and not do_shortcode to wrap that content within a toggle. I really can’t say one way or another if they will work but they should in theory.

    Regards,

    Devin

    #125849

    Hi Devin

    I’ve been working on this most of the day!

    One thing I’ve discovered is that the theme uses jquery 1.8.3 which doesn’t support the toggle method. Once I figured that out, I tried the old method:

    I added a button to the Frontpage using a “Text area” element:

    ‘<button id=”gscattoggle”>TOGGLE</button>’

    In header.php I added:

    ‘<script>

    $(“#gscattoggle”).toggle(function(){

    $(“#js_sort_items”).slideToggle(‘slow’);},

    function(){

    $(“#js_sort_items”).slideToggle(‘slow’);}

    );

    </script>’

    The button appears as expected, but nothing happens when clicked.

    I reproduced this is jsfiddle and it works perfectly. What am I doing wrong?

    Cheers

    Gary

    #125850

    Hi Gary,

    Add your script to the avia.js after :

    jQuery(document).ready(function(){

    Replace the $ with jquery just to be sure as well. See http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_Wrappers for reference on the why/what.

    Regards,

    Devin

    #125851

    Genius! Cheers Devin

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Enclose search tags in a toggle’ is closed to new replies.