Support » Plugin: WordPress Gallery Plugin - NextGEN Gallery » ngg_tag reports all comments and ping

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author photocrati

    (@photocrati)

    @olivwood – You can try the following added to your theme’s template that handles displaying your page content within its “loop” code:

    
    // Do not display NextGEN Gallery 'ngg_tags' comments.
    function ngg_tags_no_comments() {
    	return array( 'echo' => false );
    }
    
    $ngg_tags_comment_test = C_Taxonomy_Controller::get_instance();
    if ( $ngg_tags_comment_test->detect_ngg_tag( $posts, $wp_query_local ) ) {
    	add_filter( 'wp_list_comments_args', 'ngg_tags_no_comments' );
    }
    

    There may still be some custom CSS you will need based on your current theme to not display any other comment “header” details but the above will not show the list of comments.

    Also to note, the /ngg_tag/* pages are all dynamically created and as such they would not be naturally found unless you are using the Tag Cloud display type.

    Thanks!

    – Cais.

    Where needs add this filter? I try to do this code to file page.php, but not work:

    
    <?php if (have_posts()) : while (have_posts()) : the_post(); 
    // Do not display NextGEN Gallery 'ngg_tags' comments.
    function ngg_tags_no_comments() {
    	return array( 'echo' => false );
    }
    
    $ngg_tags_comment_test = C_Taxonomy_Controller::get_instance();
    if ( $ngg_tags_comment_test->detect_ngg_tag( $posts, $wp_query_local ) ) {
    	add_filter( 'wp_list_comments_args', 'ngg_tags_no_comments' );
    } ?>
    

    http://bolser.ru/ngg_tag/

    Plugin Author photocrati

    (@photocrati)

    @domovo – Custom PHP code can be added to your theme’s functions.php file; or, via another plugin such as: https://wordpress.org/plugins/code-snippets/

    Thanks!

    – Cais.

    I added this code to fuction.php. It’s not work. And after I have install plugin Wp custom template, after activation was: “Error thrown. Class ‘C_Taxonomy_Controller’ not found”

    Plugin Author photocrati

    (@photocrati)

    @domovo – Out limited testing showed this code snippet to work as expected in our test sites. If the code is not working in your particular case there may be more to the issue than what is being understood at face value.

    Do you still see the problem if you use the same code in conjunction with a default WordPress Twenty series theme (the reason why using a custom code plugin helps)?

    As to the “plugin Wp custom template” appearing to trigger issues, I cannot say what might be causing that issue, especially if the issue does not occur when that plugin is not activated.

    Thanks!

    – Cais.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘ngg_tag reports all comments and ping’ is closed to new replies.