change the $content_width

Is there are better way to change this (annoying) variable please? The Twenty Sixteen theme provides you with the twentysixteen_content_width filter, where the default is 840. To modify it you should be able to use this within your child theme’s functions.php file: add_filter( ‘twentysixteen_content_width’, function( $content_width ) { // Override the default 840 content width … Read more

Why is WordPress serving the 1024px version of my image and not the original on a 1920×1080 screen?

Your image’s src is pointing to the full size image, so it’s not an issue of permalink. The issue happens because of the sizes values. There is a variable that determines the width of your content, which then later WordPress uses to generates the responsive sizes for your images. This global variable can be set … Read more

Display oEmbed in the_excerpt

Without knowing more about your theme I can only hazard a few guesses. What are you inputting as an excerpt, what is the current output you are seeing for your excerpt, and what is the expected output? Are you seeing the URL show up in the excerpt, or is it being stripped? Oembed Are you … Read more

Define multiple Gutenberg editor widths

You may need to use the same approach that conditional editor stylesheets require now (for TinyMCE). function my_theme_add_editor_styles() { global $post; $post_type = get_post_type( $post->ID ); $editor_style=”editor-style-” . $post_type . ‘.css’; add_editor_style( $editor_style ); } add_action( ‘pre_get_posts’, ‘my_theme_add_editor_styles’ ); This snippet is from a Hongkiat article describing the process. Note: You would then have a … Read more

Can’t extract and set SVG dimensions

I solved it!!! The filter in fix #3 (above) wasn’t working because of the third condition of this if statement that triggers the dimension extraction and attachment: if (is_array($image) && preg_match(‘/\.svg$/i’, $image[0]) && $image[1] == 1) $image[1] in the third condition is the reported width of the SVG file as WP sees it before it … Read more