Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • shay1383
    Participant

    @shay1383

    sorry, copy that one:

    add_action( 'wp_footer', 'add_comment_hide_show' );
    function add_comment_hide_show() {
        ?>
        <style>
            .activity-comments ul li[id^="acomment-"]{display: none;}
        </style>
        <script type="text/javascript">
            jQuery(function($) {
                setInterval(function() {
                    $('.activity-meta').each(function() {
                        if( !$(this).find('.show-comments').length ){
                            var html = '<a href="#" class="button bp-primary-action show-comments">Show/Hide Comments</a>';
                            $(this).find('.button.acomment-reply').after(html);
                        }
                    });
    
                }, 500);
    
                $('body').on('click', '.show-comments', function(e) {
                    e.preventDefault();
                    var obj = $(this).closest('.activity-content').next('.activity-comments').find('ul li[id^="acomment-"]');
                    obj.slideToggle();
                    return false;
                });
    
            });
        </script>
        <?php
    }

    shay1383
    Participant

    @shay1383

    add_action( ‘wp_footer’, ‘add_comment_hide_show’ );
    function add_comment_hide_show() {
    ?>
    <style>
    .activity-comments ul li[id^=”acomment-“]{display: none;}
    </style>
    <script type=”text/javascript”>
    jQuery(function($) {
    setInterval(function() {
    $(‘.activity-meta’).each(function() {
    if( !$(this).find(‘.show-comments’).length ){
    var html = ‘Show/Hide Comments‘;
    $(this).find(‘.button.acomment-reply’).after(html);
    }
    });

    }, 500);

    $(‘body’).on(‘click’, ‘.show-comments’, function(e) {
    e.preventDefault();
    var obj = $(this).closest(‘.activity-content’).next(‘.activity-comments’).find(‘ul li[id^=”acomment-“]’);
    obj.slideToggle();
    return false;
    });

    });
    </script>
    <?php
    }


    shay1383
    Participant

    @shay1383

Viewing 3 replies - 1 through 3 (of 3 total)
Skip to toolbar