0

I am creating a theme by myself in wordpress. But suddenly my functions.php file stop to work. I am enqueuing a stylesheet file. First time it worked. But now its not working. whats wrong with it? (I am new in wordpress) My code is

<?php

function get_external_files(){

wp_enqueue_style('style', 'get_stylesheet_uri()');

}

add_action('wp_enqueue_scripts', 'get_external_files'); 
1
  • Remove the single quotes from get_stylesheet_uri() and try. Commented Jun 11, 2015 at 4:37

1 Answer 1

1

You've put get_stylesheet_uri() inside quotes '' turning it into a string instead of a function call... This should work:

<?php
function get_external_files(){

    wp_enqueue_style('style', get_stylesheet_uri());

}

add_action('wp_enqueue_scripts', 'get_external_files'); 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.