BuddyDev

Search

Replies

  • Participant
    Level: Guru
    Posts: 900

    Opps! so obvious

  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: Buddyblog post title checker #44566

    Awesome Brajesh

    Hope to see this feature soon

  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: [Resolved] Object cache pro question #44565

    Ok thanks

    Which is better for buddypress single server or multiple servers. Ive heard its better to have 2 servers 1 for database and one for files. Whats your opinion

  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: [Resolved] Buddypress confirm action on registration #44554

    Also is it advisable to noindex buddypress registration page.

  • Participant
    Level: Guru
    Posts: 900
  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: [Resolved] Buddyblog post views counter #44485

    Hello Ravi,

    Your code worked perfectly!

    Thanks a lot

  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: [Resolved] Buddyblog post views counter #44479

    Hello Ravi,

    This is not resolved, like I stated in the last thread that the code did not work for me.

    The counter did not display in buddyblog at all.

    Thanks

  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: [Resolved] Buddyblog post views counter #44372

    Hello the code did not work for me

    The counter did not display in buddyblog at all

    
    /* Display post views counter plugin in buddyblog post management */
    add_filter( 'pvc_display_views_count', function( $display ) {
    	if ( ! function_exists( 'buddyblog_pro' ) ) {
    		return $display;
    	}
    	$pvc = Post_Views_Counter();
    	if ( empty( $pvc->options['display'] ) || empty( $pvc->options['display']['post_types_display'] ) ) {
    		return $display;
    	}
    	$current_post_type = bblpro_get_current_post_type();
    	if ( ! $display && $current_post_type && in_array( $current_post_type, (array) $pvc->options['display']['post_types_display'] ) ) {
    		$display = true;
    	}
    	return $display;
    } );
    
    add_filter( 'the_excerpt', function ( $excerpt ) {
    	if ( ! function_exists( 'Post_Views_Counter' ) ) {
    		return $excerpt;
    	}
    	$alter = false;
    	if ( function_exists( 'bp_is_buddyblog_component' ) && bp_is_buddyblog_component() ) {
    		$alter = true;
    	} elseif ( function_exists( 'bblpro_get_queried_post_id' ) && bblpro_get_queried_post_id() ) {
    		$alter = true;
    	}
    	if ( ! $alter ) {
    		return $excerpt;
    	}
    	return $excerpt . do_shortcode( '[post-views]' );
    } );
    
  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: [Resolved] Buddyblog post views counter #44347

    The code worked but caused another issue in my blog archive pages.
    I have already added the post views shortcode into my content.php file but now your code adds another counter to the excerpt in my archive page.

    Your code should only display in buddyblog excerpt

    see screenshot https://ibb.co/5vmtTbZ

    Thanks Ravi

  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: [Resolved] Buddyblog post views counter #44342

    Now the excerpt is missing

     add_filter( 'the_excerpt', function ( $excerpt ) {
    	if ( ! function_exists( 'Post_Views_Counter' ) ) {
    		return $excerpt;
    	}
    	echo do_shortcode( '[post-views]' );
    } );