Browse Source

Merge branch 'fix/varia-issue-1461' into fix/varia-issue-1461-v2

Allan Cole 5 years ago
parent
commit
04af4330b8

+ 5 - 0
varia/functions.php

@@ -317,3 +317,8 @@ 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';

+ 38 - 0
varia/inc/jetpack.php

@@ -0,0 +1,38 @@
+<?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' );

+ 1 - 2
varia/inc/template-tags.php

@@ -201,8 +201,7 @@ if ( ! function_exists( 'varia_post_thumbnail' ) ) :
 	/**
 	 * Displays an optional post thumbnail.
 	 *
-	 * Wraps the post thumbnail in an anchor element on index views, or a div
-	 * element when on single views.
+	 * Wraps the post thumbnail in an anchor element on index views
 	 */
 	function varia_post_thumbnail() {
 		if ( ! varia_can_show_post_thumbnail() ) {

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

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