Warning: : DOMDocument::loadHTML(): Empty string supplied as input in functions.php when adding classes to post images

Here’s an updated version of the code that will avoid the warning by adding a simple check that will return $content unmodified if it’s an empty string. The original code adds <html> to the modified markup (check the page source), which we don’t want. The code below fixes that too. add_filter( ‘the_content’, ‘wpse_add_img_post_class’ ); function … Read more

Child theme .css files are not overriding their parent .css files

Try running two seperate functions with an incremental priority.. function my_enqueue_style_one() { wp_register_style( ‘style1’, get_template_directory_uri() . ‘/style1.css’ ); wp_enqueue_style( ‘style1’ ); } add_action( ‘wp_enqueue_scripts’, ‘my_enqueue_style_one’, 10 ); function my_enqueue_style_two() { wp_register_style( ‘style2’, get_stylesheet_directory_uri() . ‘/style2.css’ ); wp_enqueue_style( ‘style2’ ); } add_action( ‘wp_enqueue_scripts’, ‘my_enqueue_style_two’, 20 ); also try registering the stylesheets prior to enqueuing them for … Read more