Load child template based on parent

Instead of putting something on the template, you can keep templates clean and add to functions.php a function that use ‘template_include’ action hook to check parent page template and return same template for children pages. add_action(‘template_include’, ‘auto_child_template’); function auto_child_template( $template=”” ) { if ( ! is_page() ) { return $template; } else { $page = … Read more

WP Customize refresh problem

A likely reason you are not able to see the change in the preview is that your coming-soon.php template doesn’t include the requisite wp_head() an wp_footer() calls being made. If you look at your browser’s DOM, you should actually see that a secondary iframe is getting created behind the visible iframe. However, if your template … Read more

How do the default themes reference style.css?

The stylesheet is registered and enqueued by a function called twentyfourteen_scripts() in the theme’s functions.php. Callbacks hooked into the style loader/dependency system will be echoed on the wp_head action in the wp_head() function. Which, by the way, is how you should be loading your own stylesheets. There is a similar system for scripts.

Can’t show custom post thumbnail sizes as background images

Use this. you will need to call thumbnail sizes. $small_regular = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID), ‘small_regular’ ); $big_regular = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID), ‘big_regular’ ); echo “<style type=”text/css”>”; echo “.entry-featured-image { background-image: url(‘” . $big_regular[0] . “‘); }”; echo “@media screen and (max-width:48em) { .entry-featured-image { background-image: url(‘” . $small_regular[0] . “‘); } }”; echo “</style>”;