Hello I made a custom theme and moved it from MAMP to a cloud server. For some reason the CSS is an empty file. File path is correct, checked the file in cPanel and it has the full .css sheet. But when I go to console and follow the path it is just empty. My .js file loads fine and I beleive i enqueued the paths properly.
Any help is greatly appreciated and thank you for your time!
Functions
<?php
function paramo_script_enqueue() {
wp_enqueue_style('customstyle', get_template_directory_uri() . '/css/paramo.css'), array (), '1.0.0', all );
wp_enqueue_script('customjs', get_template_directory_uri() . '/js/paramo.js', array('jquery', 'jquery-ui-core'), '1.0.0', true );
}
add_action('wp_enqueue_scripts', 'paramo_script_enqueue');
function paramo_theme_setup() {
add_theme_support('menus');
register_nav_menu('primary', 'Primary Header Navigation');
register_nav_menu('secondary', 'Footer Navigation');
}
add_action('init', 'paramo_theme_setup');
add_theme_support('custom-header');
//enqueues our locally supplied font awesome stylesheet
function enqueue_our_required_stylesheets(){
wp_enqueue_style('font-awesome', get_stylesheet_directory_uri() . '/css/font-awesome.css');
}
add_action('wp_enqueue_scripts','enqueue_our_required_stylesheets');
?>
Hello I made a custom theme and moved it from MAMP to a cloud server. For some reason the CSS is an empty file. File path is correct, checked the file in cPanel and it has the full .css sheet. But when I go to console and follow the path it is just empty. My .js file loads fine and I beleive i enqueued the paths properly.
Any help is greatly appreciated and thank you for your time!
Functions
<?php
function paramo_script_enqueue() {
wp_enqueue_style('customstyle', get_template_directory_uri() . '/css/paramo.css'), array (), '1.0.0', all );
wp_enqueue_script('customjs', get_template_directory_uri() . '/js/paramo.js', array('jquery', 'jquery-ui-core'), '1.0.0', true );
}
add_action('wp_enqueue_scripts', 'paramo_script_enqueue');
function paramo_theme_setup() {
add_theme_support('menus');
register_nav_menu('primary', 'Primary Header Navigation');
register_nav_menu('secondary', 'Footer Navigation');
}
add_action('init', 'paramo_theme_setup');
add_theme_support('custom-header');
//enqueues our locally supplied font awesome stylesheet
function enqueue_our_required_stylesheets(){
wp_enqueue_style('font-awesome', get_stylesheet_directory_uri() . '/css/font-awesome.css');
}
add_action('wp_enqueue_scripts','enqueue_our_required_stylesheets');
?>
This looks like an issue of "File Permission" to me. Please check the file permissions on the involved folders and files.
You should find an option to change permission on the top bar or by right-clicking in cpanel. On the other hand, you can also right-click on a folder or a file and change its permission via Filezilla.
The ideal value is 755 or 750 for directories and 644 or 640 for files. Read more here the codex page
Hope this helps. Regards
Your paramo_script_enqueue()
function has a simple syntax error. The wp_enqueue_style()
function call has an add closing parenthesis before and a missing opening parenthesis around the dependencies parameter
issue in '/css/paramo.css')
and all
without parenthesis
replace
wp_enqueue_style('customstyle', get_template_directory_uri() . '/css/paramo.css'), array (), '1.0.0', all );
to
wp_enqueue_style('customstyle', get_template_directory_uri() . '/css/paramo.css', array (), '1.0.0', 'all' );
Visit Wordpress Doc - wp_enqueue_style()
function paramo_script_enqueue() {
wp_enqueue_style('customstyle', get_template_directory_uri() . '/css/paramo.css', array (), '1.0.0', 'all' );
wp_enqueue_script('customjs', get_template_directory_uri() . '/js/paramo.js', array('jquery', 'jquery-ui-core'), '1.0.0', true);
}
add_action('wp_enqueue_scripts', 'paramo_script_enqueue');