瀏覽代碼

Varia: Restore featured images for Pages (v2)

Allan Cole 5 年之前
父節點
當前提交
754a4c466d
共有 3 個文件被更改,包括 1 次插入46 次删除
  1. 1 6
      varia/functions.php
  2. 0 38
      varia/inc/jetpack.php
  3. 0 2
      varia/template-parts/content/content-page.php

+ 1 - 6
varia/functions.php

@@ -50,7 +50,7 @@ if ( ! function_exists( 'varia_setup' ) ) :
 		 *
 		 * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
 		 */
-		add_theme_support( 'post-thumbnails', array( 'post' ) );
+		add_theme_support( 'post-thumbnails' );
 		set_post_thumbnail_size( 1568, 9999 );
 
 		// This theme uses wp_nav_menu() in two locations.
@@ -317,8 +317,3 @@ require get_template_directory() . '/inc/icon-functions.php';
  * Custom template tags for the theme.
  */
 require get_template_directory() . '/inc/template-tags.php';
-
-/*
- * Load Jetpack compatibility file.
- */
-require get_template_directory() . '/inc/jetpack.php';

+ 0 - 38
varia/inc/jetpack.php

@@ -1,38 +0,0 @@
-<?php
-/**
- * Jetpack Compatibility File
- * See: https://jetpack.me/
- *
- * @package Varia
- */
-
-/**
- * Jetpack setup function.
- *
- * See: https://jetpack.com/support/content-options/
- */
-function varia_jetpack_setup() {
-
-	add_theme_support( 'jetpack-content-options',
-		array(
-			'blog-display'        => 'content', // the default setting of the theme: 'content', 'excerpt' or array( 'content', 'excerpt' ) for themes mixing both display.
-			'post-details'        => array(
-				'stylesheet'      => 'varia-style', // name of the theme's stylesheet.
-				'date'            => '.posted-on', // a CSS selector matching the elements that display the post date.
-				'categories'      => '.cat-links', // a CSS selector matching the elements that display the post categories.
-				'tags'            => '.tags-links', // a CSS selector matching the elements that display the post tags.
-				'author'          => '.byline', // a CSS selector matching the elements that display the post author.
-				'comment'         => '.comments-link', // a CSS selector matching the elements that display the comment link.
-			),
-			'featured-images'     => array(
-				'archive'         => true, // enable or not the featured image check for archive pages: true or false.
-				'archive-default' => true, // the default setting of the featured image on archive pages, if it's being displayed or not: true or false (only required if false).
-				'post'            => true, // enable or not the featured image check for single posts: true or false.
-				'post-default'    => false, // the default setting of the featured image on single posts, if it's being displayed or not: true or false (only required if false).
-				'page'            => true, // enable or not the featured image check for single pages: true or false.
-				'page-default'    => false, // the default setting of the featured image on single pages, if it's being displayed or not: true or false (only required if false).
-			),
-		)
-	);
-}
-add_action( 'after_setup_theme', 'varia_jetpack_setup' );

+ 0 - 2
varia/template-parts/content/content-page.php

@@ -17,8 +17,6 @@
 		<?php get_template_part( 'template-parts/header/entry', 'header' ); ?>
 	</header>
 
-	<?php varia_post_thumbnail(); ?>
-
 	<div class="entry-content">
 		<?php
 		the_content();