Hot answers tagged

9

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( isset( $attr['class'] ) && 'custom-logo' === $attr['class'] ) $attr['class'] = 'custom-logo foo-bar foo bar'; return $attr; } ); where ...


5

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, wp_get_attachment_image_attributes which you can use to manipulate the image attributes. So what you could do is build a filter that checks if the custom-logo class is there and if yes ...


2

Wordpress provide a filter to custom logo customization. get_custom_logo is the filter. To change logo class, this code may help you. add_filter('get_custom_logo','change_logo_class'); function change_logo_class($html) { $html = str_replace('class="custom-logo"', 'your-custom-class', $html); $html = str_replace('class="custom-logo-link"', 'your-...


2

What I read is that the parent css was loaded after the child, so the last one wins It depends on the order in which theme developer is loading stylesheets. Normally WordPress loads child theme's functions.php first and then parent theme's functions.php. the parent Emmet theme uses CSS files called differently than Style.css Yes it does. The ...


2

You can add stylesheet in back-office, but you need for that use the admin_enqueue_scripts action. See Codex reference : https://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts


1

This has to work, Im using it in several projects: add_filter( 'excerpt_more', 'my_excerpt_more' ); function my_excerpt_more( $more ) { return ''; } Just copy-paste it to your functions.php. Little bonus snippet that you might need: add_filter( 'excerpt_length', 'my_excerpt_length' ); function my_excerpt_length( $length ) { return 50; } ...


1

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 theme's functions.php and renamed the functions with some custom classes added: function FOOBAR_get_custom_logo( $blog_id = 0 ) { $html = ''; if ( ...



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