From 6a931faee1f3d1ece381a05f5e7f40b293ad4c15 Mon Sep 17 00:00:00 2001 From: Fabiano Date: Wed, 29 Aug 2018 11:25:02 -0300 Subject: [PATCH] Fix Theme Sniffer Check of Wordpress publish theme --- src/comments.php | 6 +++--- src/footer.php | 2 +- src/functions.php | 23 +++++++++++------------ src/functions/enqueues.php | 1 + src/functions/single-functions.php | 1 - src/header.php | 1 - src/tainacan/single-items.php | 5 +++-- src/template-parts/headerCollection.php | 3 ++- src/template-parts/headerTaxonomy.php | 3 ++- src/template-parts/single-post.php | 3 ++- 10 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/comments.php b/src/comments.php index ce84eda..da26463 100644 --- a/src/comments.php +++ b/src/comments.php @@ -20,7 +20,7 @@ if (post_password_required()) {

- ", "" ); ?> + ", "" ); ?>

@@ -36,7 +36,7 @@ if (post_password_required()) {
''. sprintf( __('Authenticated as %2$s', 'tainacan-theme'), get_author_posts_url($current_user->ID), $current_user->display_name) .'', @@ -48,7 +48,7 @@ if (post_password_required()) { 'cancel_reply_after' => '', 'class_submit' => 'btn btn-info bg-jungle-green align-self-center mt-3 float-right ml-auto comment-submit-link', 'label_submit' => __('Send', 'tainacan-theme'), - ]; + ); comment_form($comment_args); ?> diff --git a/src/footer.php b/src/footer.php index 75fca9d..ab7d349 100644 --- a/src/footer.php +++ b/src/footer.php @@ -50,7 +50,7 @@ Wordpress', 'Tainacan'); + printf(__('Proudly powered by %1$s and %2$s', 'tainacan-theme'), 'Wordpress', 'Tainacan'); } ?> diff --git a/src/functions.php b/src/functions.php index 13a8cdc..ef4ffa1 100644 --- a/src/functions.php +++ b/src/functions.php @@ -64,12 +64,12 @@ if(!function_exists('tainacan_setup')) { add_theme_support( 'custom-logo', $logo_args ); if (function_exists('tainacan_register_view_mode')) { - tainacan_register_view_mode('grid', [ + tainacan_register_view_mode('grid', array( 'label' => 'Thumbnail', 'description' => 'A thumbnail grid view, showing only title and thumbnail', 'icon' => '', 'dynamic_metadata' => false, - ]); + )); } add_image_size( 'tainacan-theme-list-post', 300, 200, true ); @@ -179,12 +179,11 @@ function tainacan_hex2rgb( $color ) { return array( 'red' => $r, 'green' => $g, 'blue' => $b ); } -add_filter( 'query_vars', function ( $public_query_vars ) { - +function tainacan_collections_viewmode($public_query_vars){ $public_query_vars[] = "tainacan_collections_viewmode"; return $public_query_vars; - -} ); +} +add_filter( 'query_vars', 'tainacan_collections_viewmode'); function tainacan_active($selected, $current = true, $echo = true) { @@ -197,20 +196,20 @@ function tainacan_active($selected, $current = true, $echo = true) { } -add_filter('get_the_archive_title', function($title) { +function tainacan_theme_collection_title($title){ if (is_post_type_archive('tainacan-collection')) { return __('Collections', 'tainacan-theme'); } return $title; -}); - -add_action('pre_get_posts', function($query) { +} +add_filter('get_the_archive_title', 'tainacan_theme_collection_title'); +function tainacan_theme_collection_query($query){ if ($query->is_main_query() && $query->is_post_type_archive('tainacan-collection')) { $query->set('posts_per_page', 12); } - -}); +} +add_action('pre_get_posts', 'tainacan_theme_collection_query'); require get_template_directory() . '/functions/customizer.php'; require get_template_directory() . '/functions/pagination.php'; diff --git a/src/functions/enqueues.php b/src/functions/enqueues.php index 0e247e7..dd35ebe 100644 --- a/src/functions/enqueues.php +++ b/src/functions/enqueues.php @@ -25,6 +25,7 @@ if ( ! function_exists('tainacan_Enqueues') ) { * Slick Slider Carousel */ //Styles + wp_enqueue_style('RobotoFonts', 'https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i'); wp_register_style('SlickCss', get_template_directory_uri() . '/assets/vendor/slick/css/slick.min.css', '', '1.6.1', ''); wp_register_style('SlickThemeCss', get_template_directory_uri() . '/assets/vendor/slick/css/slick-theme.min.css', '', '1.6.1', ''); wp_enqueue_style('SlickCss'); diff --git a/src/functions/single-functions.php b/src/functions/single-functions.php index 3dfd20f..4e79605 100644 --- a/src/functions/single-functions.php +++ b/src/functions/single-functions.php @@ -7,7 +7,6 @@ */ function tainacan_Comments_Callback($comment, $args, $depth) { //get comment to determine type - $GLOBALS['comment'] = $comment; global $post; //var_dump($args);die; $class_has = "has-children media comment-". $comment->comment_ID; ?> diff --git a/src/header.php b/src/header.php index fd0ef1b..23b9aa0 100644 --- a/src/header.php +++ b/src/header.php @@ -4,7 +4,6 @@ - diff --git a/src/tainacan/single-items.php b/src/tainacan/single-items.php index b63b8fc..609053a 100644 --- a/src/tainacan/single-items.php +++ b/src/tainacan/single-items.php @@ -102,7 +102,8 @@ - + + @@ -118,7 +119,7 @@
'

', 'after_title' => '

', 'before_value' => '

', 'after_value' => '

']; + $args = array('before_title' => '

', 'after_title' => '

', 'before_value' => '

', 'after_value' => '

'); //$field = null; tainacan_the_metadata($args); ?> diff --git a/src/template-parts/headerCollection.php b/src/template-parts/headerCollection.php index 1540c91..a58ef55 100644 --- a/src/template-parts/headerCollection.php +++ b/src/template-parts/headerCollection.php @@ -70,7 +70,8 @@

- + +
- + +
- + +