Make PHP work with HTML tags

From your code the proper structure would be if ( is_singular() ) { if (get_post_meta(get_the_ID(), ‘square_image’, true)) { echo ‘<img src=”‘ . get_post_meta($post->ID, ‘square_image’, true) . ‘”/>’; } else { the_post_thumbnail( ‘thumbnail’ ); } } We can make it a bit better by creating a variable that will contain the meta data so we don’t … Read more

Attribute Quote Style in WordPress HTML

First of all, either quotes are as good as each other. See this question There is no way you can do this with a plugin, action or filter. To achieve this you will have to do this manually by using the “find and replace” option on your IDE. I do not advise you to do … Read more

What makes WP so SEO friendly?

When you hear about SEO-friendliness of CMS it is essentially same as for static page – how URL looks and what gets into source of page. Essentially WP is considered SEO-friendly because: It is easy to get pretty permalinks enabled and working There is large choice of themes and plugins, aimed at following recommended SEO … Read more

CSS not affecting widget output

The problem was due to an incorrect file path in the movieposterdisplay-scripts file. Whilst the file loaded correctly in the main php file require_once(plugin_dir_path(__FILE__).’/includes/movieposterdisplay- class.php’); as it already assigned the correct plugin folder name. It did not enqueue correctly as the code was wp_enqueue_style(‘mpd-main-style’, plugins_url().’/movieposterdisplay/css/style.css’); and I had previously changed the folder name. Hence I … Read more