Add colors to existing color palette without replacing it

Using add_theme_support( ‘editor-color-palette’ ) one can replace the color palette in the Gutenberg editor by a custom one: add_theme_support( ‘editor-color-palette’, array( array( ‘name’ => __( ‘Strong magenta’, ‘themeLangDomain’ ), ‘slug’ => ‘strong-magenta’, ‘color’ => ‘#a156b4’, ), array( ‘name’ => __( ‘Light grayish magenta’, ‘themeLangDomain’ ), ‘slug’ => ‘light-grayish-magenta’, ‘color’ => ‘#d0a5db’, ), ) ); My … Read more

Remove Tag from theme support

I would remove Tag capability from classic Post type, can I use remove_theme_support( $feature ); and how to do this ? Thanks in advance 4 Answers 4 You can do it with something like this: add_action( ‘init’, ‘wpse48017_remove_tags’ ); function wpse48017_remove_tags() { global $wp_taxonomies; $tax = ‘post_tag’; // this may be wrong, I never remember … Read more

Editing the custom background CSS

I have added the add_theme_support( ‘custom-background’); function to my functions.php but the css added to the wp_head isn’t the way I want it to be. <style type=”text/css” id=”custom-background-css”> body.custom-background { background-image: url(‘http://localhost/wordpress/wp-content/uploads/2016/05/bg_green_dark.jpg’); background-repeat: no-repeat; background-position: top center; background-attachment: fixed; } </style> I have a div as background. <div id=”bg”></div> And I want to add custom-background … Read more

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

In order to use HTML5 markup for the comment forms, I add the following code snippet to functions.php: add_theme_support( ‘html5’, array( ‘comment-form’ ) ); However, it disables client side validation on form submit and I get redirected to an error page: Now, if I remove add_theme_support( ‘html5’, array( ‘comment-form’ ) ); and submit the comment … Read more

Advantages and disadvantages of using automatic-feed-links

What are the advantages and disadvantages of using add_theme_support(‘automatic-feed-links’) in my functions.php file? 2 s 2 A long time ago WordPress did not put feed links into the head element automatically. Theme or plugin authors had to do that. In 2009 automatic_feed_links() was introduced, a function that should be used in themes or plugins to … Read more