Skip to main content
27 votes
Accepted

How to add CSS class to custom logo?

WordPress provide a filter hook to custom logo customization. The hook get_custom_logo is the filter. To change logo class, this code may help you. add_filter( 'get_custom_logo', 'change_logo_class' )...
Dhinju Divakaran's user avatar
15 votes

How to add CSS class to custom logo?

Here's one suggestion how we might try to add classes through the wp_get_attachment_image_attributes filter (untested): add_filter( 'wp_get_attachment_image_attributes', function( $attr ) { if( ...
birgire's user avatar
  • 67.4k
8 votes

How to add CSS class to custom logo?

As you found yourself the_custom_logo relies on get_custom_logo, which itself calls wp_get_attachment_image to add the custom-logo class. The latter function has a filter, ...
cjbj's user avatar
  • 14.6k
8 votes
Accepted

Editing the custom background CSS

Yes, that is possible. Take a look at the codex and you will see that you can pass arguments with add_theme_support( 'custom-background'). One of them is the callback function that generates the <...
cjbj's user avatar
  • 14.6k
6 votes

Add colors to existing color palette without replacing it

You can merge palettes $existing = get_theme_support( 'editor-color-palette' ); $new = array_merge( $existing[0], array( array( 'name' => __( 'Strong magenta', 'themeLangDomain' ), ...
Vitauts Stočka's user avatar
5 votes

How to use add_theme_support('html5')?

According to the documentation, you must pass an array of items where you want to enable HTML5 markup: add_theme_support( 'html5', array( // Any or all of these. 'comment-list', 'comment-...
Pat J's user avatar
  • 11.9k
4 votes
Accepted

REQUIRED: The theme must not used the <title> tags. | REQUIRED: The theme must not call to wp_title()

WordPress added support for the title-tag feature in version 4.1 and it's now a required feature for themes uploaded to the repo. To implement this feature, make sure your theme does not have the ...
Dave Romsey's user avatar
  • 17.8k
4 votes

How to add CSS class to custom logo?

Just for anyone else that's looking for solutions. I found this, which I find much clearer than the accepted answer. Plus it gives simple ways to change the URL on the link as well! Just a little ...
Fred Bradley's user avatar
3 votes

Add colors to existing color palette without replacing it

To expand on Vitatus' answer, it works best if you're using a child theme, or a plugin, that edits the above. Assuming that the editor-colour-palette is called within a action with a default priority, ...
Rhys Wynne's user avatar
3 votes
Accepted

What is the point of needing add_theme_support( 'html5') in WordPress 5.x

You still need to do it, if you want to use HTML5 markup for certain elements. WordPress doesn't have any other way to tell the difference between "legacy" themes and more recent ones, and the old ...
Jacob Peattie's user avatar
3 votes

Will current_theme_supports return TRUE with a nonstandard add_theme_support?

As a side note for those interested, you can also pass parameters with your custom theme support. // theme functions.php add_theme_support( 'some_feature', array( 'arg_foo', 'arg_bar' ) ); // ...
Antti Koskinen's user avatar
3 votes
Accepted

How to use add_theme_support('html5')?

I have figured out why no changes happens, and the problem was that i am calling a custom search form file searchform.php and the function add_theme_support() affects the built in features only. So if ...
Mohamed Omar's user avatar
3 votes

Why does `add_theme_support( 'html5', array( 'comment-form' )` disable client side validation?

No, it is not a bug. This is how core handles it. If you look into /wp-includes/comment-template.php, you'll notice, that the only difference in <form> element, is novalidate attribute added, ...
Frank P. Walentynowicz's user avatar
3 votes

add image size still doesn't work even after regenerating thumbnails

Another thing to check if your expected images aren't being generated is to see if any image sizes are being generated. Check your uploads directory. If there are not multiple entries for largish ...
Privateer's user avatar
  • 1,892
2 votes

How to add CSS class to custom logo?

I think I found one answer. But I really wonder if this is the right way? It feels a little bit dirty somehow: I simply copied the logo related parts from wp-includes/general-template.php into my ...
leymannx's user avatar
  • 3,161
2 votes
Accepted

how to pull images with no add_theme_support('post_thumbnails')

If you don't want to modify the theme or add a child theme to handle post thumbnail support, you can do it via a plugin by attaching a callback to the after_setup_theme hook: <?php /* Plugin Name: ...
Dave Romsey's user avatar
  • 17.8k
2 votes

Override image maximum width in theme (Using Gutenberg editor)

add_theme_support('gutenberg', ['wide-images' => true ]) is telling gutenberg, hey this sites content area's CSS is setup to handle wide images. The theme_support wide-images code isn't a magic fix ...
David Sword's user avatar
  • 3,337
2 votes
Accepted

Will current_theme_supports return TRUE with a nonstandard add_theme_support?

Yes. You can take advantage of this to enable or disable features in your plugin if a theme does or does not declare support for a feature. WooCommmerce is an example of a plugin that does this.
Jacob Peattie's user avatar
2 votes
Accepted

"add_theme_support" for custom footer color?

You can use following class put inside your theme's functions.php file. Theme Customization API will render the custom color selector control on the Theme customizer from this. class ...
Vishwa's user avatar
  • 376
2 votes

Add colors to existing color palette without replacing it

The best way would be to expose the data, so it can be modified. You can do this by adding a filter: add_theme_support( 'editor-color-palette', apply_filters( '...
Tim Elsass's user avatar
  • 1,343
2 votes
Accepted

Theme support title tag - how to replace the default WP separator (with a filter)?

You use the document_title_separator filter. So in your case: <?php function theme_prefix_filter_document_title_separator() { return '|'; } add_filter( 'document_title_separator', '...
Fränk's user avatar
  • 514
2 votes

Remove or rename "Default" from Gutenberg typography settings

Future readers: I will update this answer based on further research if I find a better way to do it, but this represents the current best effort. If you are reading this, and curious if I found a ...
Tom J Nowell's user avatar
  • 59.6k
2 votes

.editor-styles-wrapper overriding my block styles in Gutenberg

This isn't quite the solution I was looking for, but I realized that by making the tags more specific in the block stylesheets, I was able to prevent most issues from happening. By adding a div tag to ...
AGKlem's user avatar
  • 41
1 vote
Accepted

add_theme_support('post-thumbnail') not working

That one line is all you need, try adding this to your functions.php file. function my_theme_setup(){ add_theme_support('post-thumbnails'); } add_action('after_setup_theme', 'my_theme_setup'); ...
RiddleMeThis's user avatar
  • 3,767
1 vote

What flex-width/height does?

flex-width stands for flexible width and flex-height stands for flexible height <?php // Previous function code here $args = array( 'default-image' => ...
Chaudhari Akash's user avatar
1 vote

Footer Columns Size

How to Restore using UpDraft is quite easy and you can follow this instruction carefully. https://www.youtube.com/watch?v=64S4S92v_0Q
Harish Kumar's user avatar
1 vote
Accepted

Post thumbnail not showing in WP admin area for custom post type

I think it's possible the 2 separate enabling statements may be interfering with each other. The purpose of having an array is to combine them into one enabling statement. Try the following in your ...
Ray Gulick's user avatar
1 vote

Override post-formats in child theme

Make sure that you're not just calling these functions within functions.php, but calling them at the right time with add_action(). Try the following: // in your Child Theme's functions.php // ...
Josh's user avatar
  • 11
1 vote

Override post-formats in child theme

It's import to set the priority for your after_setup_theme higher than your parent theme. The default priority is 10. Using the twentysixteen as example, use priority 11 on child themes' '...
cbonomini's user avatar
  • 126
1 vote

Show video as part of the post?

If the video is on the embeds list then you should be able to just paste a link and it will appear. Like this: https://youtu.be/BjJ1A-1JKh0 You can also use a shortcode for a little more control ...
Bryan Hoffman's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible