|
@@ -36,41 +36,3 @@ function varia_jetpack_setup() {
|
|
|
);
|
|
|
}
|
|
|
add_action( 'after_setup_theme', 'varia_jetpack_setup' );
|
|
|
-
|
|
|
-/**
|
|
|
- * Custom function to check for a post thumbnail;
|
|
|
- * If Jetpack is not available, fall back to has_post_thumbnail()
|
|
|
- */
|
|
|
-function varia_has_post_thumbnail( $post = null ) {
|
|
|
- if ( function_exists( 'jetpack_has_featured_image' ) ) {
|
|
|
- return jetpack_has_featured_image( $post );
|
|
|
- } else {
|
|
|
- return has_post_thumbnail( $post );
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * Display a Featured Image on archive pages if option is ticked.
|
|
|
- */
|
|
|
-function varia_jetpack_featured_image_archive_display() {
|
|
|
- if ( ! function_exists( 'jetpack_featured_images_remove_post_thumbnail' ) ) {
|
|
|
- return false;
|
|
|
- } else {
|
|
|
- $options = get_theme_support( 'jetpack-content-options' );
|
|
|
- $featured_images = ( ! empty( $options[0]['featured-images'] ) ) ? $options[0]['featured-images'] : null;
|
|
|
-
|
|
|
- $settings = array(
|
|
|
- 'archive-default' => ( isset( $featured_images['archive-default'] ) && false === $featured_images['archive-default'] ) ? '' : 1,
|
|
|
- );
|
|
|
-
|
|
|
- $settings = array_merge( $settings, array(
|
|
|
- 'archive-option' => get_option( 'jetpack_content_featured_images_archive', $settings['archive-default'] ),
|
|
|
- ) );
|
|
|
-
|
|
|
- if ( $settings['archive-option'] ) {
|
|
|
- return true;
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|