WordPress.org

Support

Support » Plugins and Hacks » Jetpack by WordPress.com » [Resolved] Filter Sharing Buttons In Minileven Theme

[Resolved] Filter Sharing Buttons In Minileven Theme

  • Hi Guys,

    Thanks for the update! I decided to give the mobile version a try, but was wondering how to disable the Sharing buttons from the mobile theme. I want to echo the sharing display on to the top of the post instead of the bottom.

    What additional filter will I need to add to this in my functions? Perhaps there can be an option to choose the top of the post or bottom in future updates?

    function jptweak_remove_share() {
    	remove_filter( 'the_content', 'sharing_display',19 );
    	remove_filter( 'the_excerpt', 'sharing_display',19 );
    }
    add_action( 'loop_end', 'jptweak_remove_share' );

    Many Thanks In Advance!

    http://wordpress.org/plugins/jetpack/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jeremy Herve

    @jeherve

    You can use the same filters, but you will need to apply them only if you’re on mobile.

    You can build a small plugin for that, and use the following code:

    // Check if we are on mobile
    function jetpackme_is_mobile() {
    
        // Are Jetpack Mobile functions available?
        if ( ! function_exists( 'jetpack_is_mobile' ) )
            return false;
    
        // Is Mobile theme showing?
        if ( isset( $_COOKIE['akm_mobile'] ) && $_COOKIE['akm_mobile'] == 'false' )
            return false;
    
        return jetpack_is_mobile();
    }
    
    // Let's remove the sharing buttons, but only if we're on a mobile device
    function jetpackme_maybe_add_filter() {
    
        // On mobile, and on the home page?
        if ( jetpackme_is_mobile() ) {
            remove_filter( 'the_content', 'sharing_display',19 );
    		remove_filter( 'the_excerpt', 'sharing_display',19 );
        }
    }
    add_action( 'wp_head', 'jetpackme_maybe_add_filter' );
    
    // Build the function
    function jptweak_remove_share() {
    	remove_filter( 'the_content', 'sharing_display',19 );
    	remove_filter( 'the_excerpt', 'sharing_display',19 );
    }

    You can find out more about how to customize the mobile theme here:
    http://jetpack.me/2013/06/27/customize-mobile-theme/

    Oh I see now. Awesome, thanks a bunch!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Filter Sharing Buttons In Minileven Theme’ is closed to new replies.
Skip to toolbar