themes-wordpress/skatepark/functions.php
Ben Dwyer 8f72219e9d
Blockbase: Add child CSS if it exists (#5047)
* Blockbase: Add child CSS if it exists

* add comment
2021-11-17 19:04:16 +00:00

23 lines
499 B
PHP

<?php
/**
* Block Patterns.
*/
require get_stylesheet_directory() . '/inc/block-patterns.php';
/**
* Block Styles.
*/
require get_stylesheet_directory() . '/inc/block-styles.php';
/**
* Add class to body if post/page has a featured image.
*/
function add_featured_image_class( $classes ) {
global $post;
if ( isset ( $post->ID ) && get_the_post_thumbnail( $post->ID ) ) {
$classes[] = 'has-featured-image';
}
return $classes;
}
add_filter( 'body_class', 'add_featured_image_class' );