• Hi All,

    I have created a theme from scratch based on a website page layout and content (including css, JavaScript, images, etc). This is a responsive website on its own with everything fully functioning. I followed the WordPress standards and methods of creating themes. But when I install the theme and enable it in WordPress, I get just a static HTML page with no css formatting, images appearing or JavaScript effects.

    I was wondering if anyone has had a problem like this before, or could point me to the right post/solution page.

    Thanks in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator t-p

    (@t-p)

    Does it work if you use the default theme?

    Hey menre,

    This sounds like you didn’t tell the page where to find your stylesheets.

    In your header.php do you have this declared:

    <link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" />

    Also, in your style.css you’ll need to make sure you have:

    @import url("stylesheets/yourstylesheet.css");

    Hope that helps.

    Ninja vanish!

    Thread Starter menre

    (@menre)

    Thanks all for your responses so far. As for your question Tara, yes the default theme works well.

    Thank you for your suggestions ImageOmega. I used the link below and it helped a bit.

    <link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" />

    But the code below is a bit confusing to me.
    @import url(“stylesheets/yourstylesheet.css”);

    Another issue I am dealing with now is to make the JavaScript display. Do I need to reference the link in a specific way?

    I will appreciate further help, please.

    Thread Starter menre

    (@menre)

    Thanks all for your responses so far. As for your question Tara, yes the default theme works well.

    Thank you for your suggestions ImageOmega. I used the link below and it helped a bit.

    <link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" />

    But the code below is a bit confusing to me.
    @import url(“stylesheets/yourstylesheet.css”);

    Another issue I am dealing with now is to make the JavaScript display. Do I need to reference the link in a specific way?

    I will appreciate further help, please.

    Moderator t-p

    (@t-p)

    yes the default theme works well.

    It means there is a problem specific to the theme you are using.

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Part of the reason you are having issues with your styles and scripts is that you may not be enqueuing them properly.

    Best practice is to hook them to wp_enqueue_scripts that way you not only have a cleaner header file ( if you have one ) but if you decide to decide to publically share your theme it will be a little easier to create a child theme for it. 🙂

    So what you would do is create a callback function in your functions file:

    //hook to wp_enqueue_scripts
    add_action ( 'wp_enqueue_scripts', 'my_scripts_styles' );
    function my_scripts_styles(){
        wp_enqueue_script( 'my-js', get_template_directory_uri() . /js/my-js-file.js' );
        wp_enqueue_style( 'my-theme-style', get_stylesheet_uri() );
    }

    Resources:
    wp_enqueue_scripts
    wp_enqueue_script
    wp_enqueue_styles

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Imported theme not responsive’ is closed to new replies.