page-name.php doesn’t execute on custom template

Don’t name your custom page template files page-{foobar}.php. Doing so will cause just this conflict with the Template Hierarchy for static pages: custom template file – The Page Template assigned to the Page. See get_page_templates(). page-{slug}.php – If the page slug is recent-news, WordPress will look to use page-recent-news.php page-{id}.php – If the page ID … Read more

Wrapping images in tags based on size

You can wrap specific sizes in arbitrary html when they’re inserted into post content via the image_send_to_editor filter. Here we check if $size is thumbnail and wrap it in a div, otherwise we just return the unaltered $html: function wpd_wrap_thumbnails( $html, $id, $caption, $title, $align, $url, $size, $alt ){ if( ‘thumbnail’ == $size ){ return … Read more

Add external css to Contact Page

I do feel that you are trying to over complicate things here. What you want to achieve would be easier in a child theme. It is something that I would consider as it is really something simple that you want to achieve. All you simply will need to do, copy the contact form template to … Read more