0

I am new to Wordpress and I need to convert a PSD int a Wordpress theme. For that I downloaded a naked wordpress theme to start with and I tried to add my own css style in function.php as follows:

function naked_scripts() { // get the theme directory style.css and link to it in the header wp_enqueue_style( 'main-style', get_template_directory_uri() . '/style/main.css' ); wp_enqueue_style( 'responsive-style', get_template_directory_uri() . '/style/responsive.css' ); wp_enqueue_style( 'bootstrap-style', get_template_directory_uri() . '/style/bootstrap.min.css' ); // add fitvid wp_enqueue_script( 'jquery-js', get_template_directory_uri() . '/js/jquery.js', array( 'jquery' ), '1.10.2', true ); // add theme scripts wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '3.0.3', true ); } add_action( 'wp_enqueue_scripts', 'naked_scripts' ); // Register this fxn and allow Wordpress to call it automatcally in the header 

but in the browser I did not get my style and I have his error:

 GET http://rota.alwaysdata.net/wp-content/themes/theme1/style/main.css?ver=4.1 

what's ver=4.1 ??

1
  • underscores.me is a best place to setup a wordrpess tempalte than make changes as required by your PSD template. Commented Feb 3, 2015 at 10:47

2 Answers 2

1

It's a cache-buster added by WordPress. You can set it to any number you want using the $ver argument in wp_enqueue_style

http://codex.wordpress.org/Function_Reference/wp_enqueue_style

The ?ver=X.XX has NO effect on the content of the stylesheet.

CSS Cache-busting references:

http://css-tricks.com/snippets/wordpress/prevent-css-caching/ https://www.mojowill.com/developer/get-your-wordpress-css-changes-noticed-immediately/

Sign up to request clarification or add additional context in comments.

Comments

0

I suggest if it's your first time creating a wordpress template using these resources:

  1. Underscores blank wordpress theme: http://underscores.me/

  2. Lynda.com underscores tutorial:
    http://www.lynda.com/underscores-tutorials/WordPress-Building-Themes-from-Scratch-Using-Underscores/163092-2.html

This is what i used to make my first wordpress project and it worked out grate , here is the result: ibreatheart.com

Hope it helps .

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.