Fix Theme Sniffer Check of Wordpress publish theme

This commit is contained in:
Fabiano 2018-08-29 11:25:02 -03:00
parent 1ddae4f4c4
commit 6a931faee1
10 changed files with 25 additions and 23 deletions

View File

@ -20,7 +20,7 @@ if (post_password_required()) {
<div id="respond" class="clearfix mt-5 <?php if(!wp_is_mobile()) { ?>margin-two-column<?php } ?>">
<?php if(get_option('comment_registration') && !is_user_logged_in()) : ?>
<p>
<?php printf( __( 'You must be %slogged%s in to post a comment.', 'tainacan-theme'), "<a href='" . esc_url( home_url() ) . "/wp-login.php'>", "</a>" ); ?>
<?php printf( __( 'You must be %1$slogged%2$s in to post a comment.', 'tainacan-theme'), "<a href='" . esc_url( home_url() ) . "/wp-login.php'>", "</a>" ); ?>
</p>
<?php else : ?>
<div for="comment" class="d-flex mb-2">
@ -36,7 +36,7 @@ if (post_password_required()) {
</div>
<?php
$comment_args = [
$comment_args = array(
'logged_in_as' => '<span class="text-oslo-gray authenticated d-inline d-sm-none mb-4">'.
sprintf( __('Authenticated as <a href="%1$s" class="font-weight-light">%2$s</a>', 'tainacan-theme'), get_author_posts_url($current_user->ID), $current_user->display_name)
.'</span>',
@ -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);
?>
<?php endif; ?>

View File

@ -50,7 +50,7 @@
<span>
<?php
if ( true == get_theme_mod( 'display_powered', false ) ) {
printf(__('Proudly powered by %s and %s', 'tainacan-theme'), '<a href="https://wordpress.org/">Wordpress</a>', '<a href="http://tainacan.org/">Tainacan</a>');
printf(__('Proudly powered by %1$s and %2$s', 'tainacan-theme'), '<a href="https://wordpress.org/">Wordpress</a>', '<a href="http://tainacan.org/">Tainacan</a>');
}
?>
</span>

View File

@ -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' => '<span class="icon"><i class="mdi mdi-apps mdi-24px"></i></span>',
'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';

View File

@ -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');

View File

@ -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; ?>

View File

@ -4,7 +4,6 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i" rel="stylesheet">
<?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php endif; ?>

View File

@ -102,7 +102,8 @@
</a>
<?php endif; ?>
<?php if ( true == get_theme_mod( 'twitter_share', true ) ) : ?>
<?php $via = !empty(get_option( 'twitter_user')) ? '&amp;via=' . get_option( 'twitter_user') : ''; ?>
<?php $twitter_option = get_option( 'twitter_user'); ?>
<?php $via = !empty($twitter_option) ? '&amp;via=' . get_option( 'twitter_user') : ''; ?>
<a href="http://twitter.com/share?url=<?php the_permalink(); ?>&amp;text=<?php the_title_attribute(); ?><?php echo $via; ?>" target="_blank" class="item-card-link--sharing">
<img src="<?php echo get_template_directory_uri().'/assets/images/twitter-circle.png'; ?>" alt="">
</a>
@ -118,7 +119,7 @@
</div>
<div class="col col-md-8 s-item-collection--metadata">
<?php
$args = ['before_title' => '<div><h3>', 'after_title' => '</h3>', 'before_value' => '<p>', 'after_value' => '</p></div>'];
$args = array('before_title' => '<div><h3>', 'after_title' => '</h3>', 'before_value' => '<p>', 'after_value' => '</p></div>');
//$field = null;
tainacan_the_metadata($args);
?>

View File

@ -70,7 +70,8 @@
<h2 class="t-collection--info-title text-white">
<?php tainacan_the_collection_name(); ?>
</h2>
<?php if ( !empty(tainacan_get_the_collection_description()) ): ?>
<?php $tainacan_collection_description = tainacan_get_the_collection_description(); ?>
<?php if ( !empty($tainacan_collection_description) ): ?>
<div class="text-white t-collection--info-description-text dotmore">
<?php
tainacan_the_collection_description();

View File

@ -27,7 +27,8 @@
<h2 class="t-collection--info-title text-white">
<?php tainacan_the_term_name(); ?>
</h2>
<?php if ( !empty(tainacan_get_the_term_description()) ): ?>
<?php $tainacan_collection_description = tainacan_get_the_collection_description(); ?>
<?php if ( !empty($tainacan_collection_description) ): ?>
<div class="text-white t-collection--info-description-text dotmore">
<?php
tainacan_the_term_description();

View File

@ -11,7 +11,8 @@
</a>
<?php endif; ?>
<?php if ( true == get_theme_mod( 'twitter_share', true ) ) : ?>
<?php $via = !empty(get_option( 'twitter_user')) ? '&amp;via=' . get_option( 'twitter_user') : ''; ?>
<?php $twitter_option = get_option( 'twitter_user'); ?>
<?php $via = !empty($twitter_option) ? '&amp;via=' . get_option( 'twitter_user') : ''; ?>
<a href="http://twitter.com/share?url=<?php the_permalink(); ?>&amp;text=<?php the_title_attribute(); ?><?php echo $via; ?>" target="_blank" class="">
<img src="<?php echo get_template_directory_uri().'/assets/images/twitter-circle.png'; ?>" alt="">
</a>