This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Removing comments

  • Creator
    Topic
  • #2084
    karlo
    Participant

    I can see this work but just thought it would be best to get a nod! I have learned that just because something seems to work it does not mean is smart!

    // Remove comments 
    function themeblvd_show_comments() {
    	global $post;
    	$show = true;
    	if( is_single() ) {
    		if( themeblvd_get_option( 'single_comments', null, 'show' ) == 'hide' )
    			$show = false;
    		if( get_post_meta( $post->ID, '_tb_comments', true ) == 'hide' )
    			$show = false;
    		else if( get_post_meta( $post->ID, '_tb_comments', true ) == 'show' )
    			$show = true;
    		// My chunk 
    		if ( has_post_format ( 'link' ) || has_post_format ( 'quote' ) || has_post_format ( 'status' ) || has_post_format ( 'video' ) || in_category ( 106 )) 
    			$show = false;
    	}
    	return $show;
    }

    I did not know this function so went looking for native tricks but as it often goes there is no clear message and I get confused.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #2085
    karlo
    Participant

    Also I wil pimp Jumpstart harder if you add this to BBpress CSS 🙂

    .bbp-topic-content pre {
        overflow: auto;
        white-space: pre;
    }
    #2102
    Jason Bobich
    Keymaster

    You’re just talking about the comments and comment form on single posts? There’s actually a nifty little filter in the theme you can use to show/hide comments. It’s on the “themeblvd_global_config” array — It only exists in single.php and page.php, so there’s no need to check for is_single().

    function my_global_config( $setup ){
    	
    	if( $whatever ) 
    		$setup['comments']['posts'] = false;
    	
    	return $setup;
    	
    }
    add_filter( 'themeblvd_global_config', 'my_global_config' );
    #2110
    karlo
    Participant

    Thanks. I will check.

    Would also be odd if there only was one way of achieving goal! Unheard of 🙂

    #2116
    karlo
    Participant
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.