All Questions
21 questions
1
vote
0
answers
136
views
How to check if a WordPress core block is active in sidebar
I have a widget area and I want to enqueue a stylesheet only if a core block is active in it. I tried the following code:
// if has audio block.
if (has_block('audio')) {
wp_enqueue_style('audio-...
0
votes
0
answers
248
views
Advanced method to control cache of enqueued style/script
I have a WordPress website with medium-level traffic, ~10,000 unique visitors a day. Arround 30% of my daily visitors are recurrent. I constantly make some UI improvements: colors, font-size, ...
0
votes
1
answer
25
views
theme style is applied on the dhasboard rather than the website
I am creating a new theme, I created a new directory called mytheme and created three files directly inside the directory where the content is as follow:
index.php
<?php echo "hellow world&...
0
votes
0
answers
32
views
Problem with displaying CSS Stylesheets - Am I adding them correctly in my wordpress child theme?
Is this a proper way to load CSS files into my WordPress child theme?
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
add_action( 'wp_enqueue_scripts', 'case_studies_styles' );
...
1
vote
1
answer
580
views
Dequeue a style file which is making website load slow!
I have a website running on GrandNews WordPress Theme (https://themeforest.net/item/grand-news-news-magazine/15885465) and loading via KeyCDN. The site is loading a CSS file located at websitedomain....
1
vote
0
answers
1k
views
Font Awesome 5 Free - far working but fas is not? [closed]
This is making me crazy.
I'm using Font Awesome 5 Free in custom list styles using :before and content:
In every instance, far icons are working and fas icons are not.
I've checked everything I ...
0
votes
2
answers
2k
views
I can't add CSS with functions.php
I'm relatively new to creating a theme with WordPress, and I've been adding all the stylesheets (main and for each page) with the old echo get_stylesheet_uri();. But I find out that this isn't the ...
2
votes
3
answers
1k
views
Is it possible to use the featured image of a page as a css background without inlining?
So, I'm totally new to WordPress and trying to "convert" a static site to a WP theme.
I have a page where I'd like to use the featured image as a background for a div.
I was wondering what is the ...
1
vote
1
answer
406
views
How remove render blocking css from wordpress when you build a theme?
Is there any good way to avoid render blocking css (google page speed) from Wordpress. Probably more complex, but find a way to add in theme development. It means, not something very specific but ...
2
votes
1
answer
48
views
De-registering parent style sheet css recommended?
Just a general question: I am just wondering, why every tutorial for child themes still includes the parent's stylesheet. Would it not be preferable to de-enqueue & to de-register the parent's ...
0
votes
2
answers
916
views
Ideal inline dynamic CSS injection
There is a code in here that dynamically load custom script.
<?php
function my_styles_method() {
wp_enqueue_style(
'custom-style',
get_template_directory_uri() . '/css/...
2
votes
2
answers
3k
views
Enqueued Stylesheets Effecting Admin Styles
I'm building a custom theme for a client and I've been adding stylesheets incorrectly for a while, so I decided to do it the correct way :-).
However, when I add the stylesheet to my functions.php ...
2
votes
1
answer
1k
views
Adding inline styles from a widget
I'm working on a theme that has an optional widget to allow users to put some site elements where they want. One of those is a list of social media icons. These are font icons, so they can be styled ...
1
vote
1
answer
180
views
Theme Loading Into Dashboard
I'm having this really weird, never seen before, issue ... whenever I visit the Dashboard, after about 3-5 seconds, my theme loads into the Dashboard layout. It's like the theme's stylesheet is being ...
0
votes
2
answers
140
views
Some questions about how proper add 2 CSS file in a WordPress theme?
I have the following situation loading a CSS.
I have a WordPress theme that load a style.css settings file by this code into my functions.php file:
/* Function automatically executed by the hook:
* ...
5
votes
2
answers
3k
views
Why I can't add a CSS style in this WordPress theme?
I am trying to add a CSS style to a WordPress theme that I am developing as is shown in this tutorial: http://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/ ...
10
votes
1
answer
6k
views
Enqueue a stylesheet for login page and make it appear in head element
I try to style the login page in my theme. Very simple:
add_action( 'login_enqueue_scripts', function()
{
wp_enqueue_style( 'TEST', get_template_directory_uri() . '/css/login.css' );
});
...
1
vote
4
answers
6k
views
enqueue_style is not working
I try to load the main stylesheet with enqueue_style - but it isn't working.
Here is my code from functions.php:
function my_scripts() {
wp_enqueue_style( 'main-style', ...
0
votes
2
answers
154
views
How do I use a color from theme options?
I am building a theme, and in the options I have created a place for link color. I cant seem to get this into the theme in any reasonable way. The best I can do is to put it after wp_head ... but that ...
0
votes
1
answer
343
views
Having issue with WordPress wp_enqueue_style
I am building a full design into WordPress for the first time and I am trying to load in stylesheets and script files but all I seem to be getting is the text output of the location.
What I have is ...
20
votes
3
answers
4k
views
How important is it to enqueue a theme's stylesheet?
I have trawled the net looking for an answer to this, but for some reason all I can find are actual examples, but without that particular explanation, which is clear say in the case of scripts. Can ...