style.css not working
adding this to my function worked:
function load_scripts() {
wp_enqueue_style( ‘stylecss’, get_stylesheet_uri() ); }
add_action(‘wp_enqueue_scripts’, ‘load_scripts’ );
this also worked (first part, 2nd part was original to try which did not):
function custom_theme_assets() {
wp_enqueue_style( ‘style’, get_stylesheet_uri() );}
add_action( ‘wp_enqueue_scripts’, ‘custom_theme_assets’ ); as compared to:
function files() {
wp_enqueue_style( ‘style’, get_stylesheet_uri() );}
add_action( ‘wp_enqueue_scripts’, ‘files’ );
while WP might be used by lots it still has many features and BAD DESIGNS… too many variables for simple things. trying to find out why my style would not work. i found all of these THAT ALSO DID NOT WORK FOR ME:
in header:
<link … href=”<?php bloginfo(‘template_directory’); ?>/css/bootstrap.css” />
<link … href=”<?php bloginfo(‘template_directory’); ?>/style.css” />
also in header:
<link href=”<?php bloginfo(‘stylesheet_url’); ?> rel=”stylesheet” type=”text/css” media=”all” />
<link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>”>
in function:
add_action( ‘wp_enqueue_scripts’, ‘theme_name_scripts’ );
function theme_name_scripts() {
wp_enqueue_style( ‘style-name1’, get_stylesheet_uri() . “/css/style.css” );
wp_enqueue_style( ‘style-name2’, get_stylesheet_uri() . “/css/bootstrap.css” );}
another for adding to function:
function EnqueueMyStyles() {
wp_enqueue_style(‘my-custom-style’, get_template_directory_uri() . ‘/css/my-custom-style.css’, false, ‘20150320’);
wp_enqueue_style(‘my-google-fonts’, ‘//fonts.googleapis.com/css?family=PT+Serif+Caption:400,400italic’, false, ‘20150320’);
wp_enqueue_style(‘my-main-style’, get_stylesheet_uri(), false, ‘20150320’); }}
add_action(‘wp_enqueue_scripts’, ‘EnqueueMyStyles’);
there were MANY other post about how to FIX the problem too… many were just similiar to ones above with a deferent word at start/end of some lines but i am guessing while they work for some themes/computer/devices they do not for all??? NEEDS TO BE LESS COMMANDS/VARIABLES TO DO SAME THING