WordPress.org

Ready to get started?Download WordPress

Forums

wp_enqueue_style() automattic _s responsive (1 post)

  1. joesnellpdx
    Member
    Posted 2 years ago #

    Howdy howdy,

    I need your help. I'm developing an responsive, mobile first site using the awesome _s them from automattic. The only stumbling block I'm running into is how to best handle the stylesheets.

    The theme uses wp_enqueue_style() in functions.php as so:

    function joetheme_scripts() {
    global $post;

    wp_enqueue_style( 'style', get_stylesheet_uri() );

    wp_enqueue_script( 'small-menu', get_template_directory_uri() . '/js/small-menu.js', array( 'jquery' ), '20120206', true );

    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
    wp_enqueue_script( 'comment-reply' );
    }

    if ( is_singular() && wp_attachment_is_image( $post->ID ) ) {
    wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' );
    }
    }
    add_action( 'wp_enqueue_scripts', 'joetheme_scripts' );

    Okay, simple enough right? Here is my goal in regular old html markup (via Brad Frost at http://www.html5rocks.com/en/mobile/responsivedesign):

    <link rel="stylesheet" type="text/css" href="style.css" media="screen, handheld" />
    <link rel="stylesheet" type="text/css" href="enhanced.css" media="screen and (min-width: 40.5em)" />
    <!--[if (lt IE 9)&(!IEMobile)]>
    <link rel="stylesheet" type="text/css" href="enhanced.css" />
    <![endif]-->

    So here is your assignment, if you chose to help me out (I will so appreciate it!).

    What would my code look like if I correctly utilize wp_enqueue_style() in functions.php?

    THANK YOU!!!!!!!

Topic Closed

This topic has been closed to new replies.

About this Topic