WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] Minileven child theme (4 posts)

  1. snapalot
    Member
    Posted 1 year ago #

    Is there any way to create a child theme for minileven, Jetpack's mobile theme? Every time Jetpack is updated I have to change minileven all over again.

    I do not want to use the Custom CSS module included in Jetpack, because I do not want other admins on my site to have access to the CSS.

    I have high praise and much appreciation for you guys building Jetpack.

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

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    While you can't use a Minileven child theme, you could load a custom stylesheet via a small plugin. You can follow the tutorial here to get started:
    http://jetpack.me/2013/06/27/customize-mobile-theme/#throughactionsandfilters

    Instead of hooking the jetpackme_author_image function, you'll want to hook your own function that loads the stylesheet.

  3. snapalot
    Member
    Posted 1 year ago #

    Thank you Jeremy!

  4. snapalot
    Member
    Posted 1 year ago #

    Here's the plugin I wrote should anybody else need it:

    // 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();
    }
    
    // On mobile?
    if ( jetpackme_is_mobile() ) {
        add_action( 'wp_enqueue_scripts', 'jetpackme_custom_css' );
    }
    
    // Build the function
    function jetpackme_custom_css() {
    
        wp_enqueue_style( 'custom-style', plugins_url( 'custom-style.css', __FILE__ ), array('style'), '20120208', 'all' );
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic