Make it possible to pick a color theme for specific pages

You can add custom metabox for each page. Paste the following code to functions.php class colorMetabox { private $screen = array( ‘post’, ); private $meta_fields = array( array( ‘label’ => ‘Page Color’, ‘id’ => ‘page_color’, ‘type’ => ‘color’, ), ); public function __construct() { add_action( ‘add_meta_boxes’, array( $this, ‘add_meta_boxes’ ) ); add_action( ‘save_post’, array( $this, … Read more

Console error, even if everything is working?

The colour picker is working fine because it’s a separate script being enqueued as a dependency of custom-script-handle. So even if custom-script-handle isn’t loading because the URL is wrong the colour picker script will still load. If you don’t enqueue custom-script-handle then the colour picker won’t work because the script is being enqueued at all. … Read more

Are theme .php files stored in the database?

No, a theme’s .php files are not stored in the database. Themes should not be hardcoding URLs in their files. However, it’s totally possible for this to happen, particularly with a custom theme or plugins whose developer did not follow best practices. I’d suggest using a search utility such as grep (grepwin is nice for … Read more

Investigating complex themes still slow even with WP caching

Typically page builder themes and plugins are compatible with caching. The reason they still tend to slow down websites is because they are very resource-intensive. In WP there are two main resources – data from the database, and files. Because page builders can do almost anything you can imagine, they have to come with enough … Read more

Child theme not working after Parent Theme Update

What I’d do is to back up the child theme and then install the basic child theme they suggest, which you can find here, that new child should work then you can start implementing the customizations that you have on the old child theme into the new one and see when the errors pop again, … Read more

How do I set the featured image size on the single post?

You can set the featured image size in second parameter based on this document // without parameter -> Post Thumbnail (as set by theme using set_post_thumbnail_size()) get_the_post_thumbnail( $post_id ); get_the_post_thumbnail( $post_id, ‘thumbnail’ ); // Thumbnail (Note: different to Post Thumbnail) get_the_post_thumbnail( $post_id, ‘medium’ ); // Medium resolution get_the_post_thumbnail( $post_id, ‘large’ ); // Large resolution get_the_post_thumbnail( … Read more