Skip to main content

All Questions

Filter by
Sorted by
Tagged with
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-...
Zeddy Emy's user avatar
1 vote
2 answers
312 views

CSS not affecting widget output

so I am still quite new to wordpress development so don't rage and I am sorry if I did something really stupid. So I am having trouble with my CSS, for some reason it's not affecting the widget ...
Dev john's user avatar
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 ...
cjbj's user avatar
  • 15k
0 votes
1 answer
276 views

How do I get shortcode, widget and template tag CSS to load in the head only as required? [duplicate]

I have a shortcode, widget and template tag that need to load CSS. I am registering in init, and enqueueing as required. The only problem is, it is adding the CSS loader at the bottom of the page, ...
Chris Howard's user avatar
5 votes
1 answer
9k views

How to use wp_dequeue_style() for style enqueued in WP_Widget class

I've got a plugin that makes a widget that enqueues some front-end CSS to style the widdget. I call wp_enqueue_style from the public widget() method in the extended WP_Widget class: <?php class ...
mrwweb's user avatar
  • 10.3k