AmoSan 54 Posted February 27, 2018 Report Share Posted February 27, 2018 Помогите пожалуйста убрать лишний текст из превью новости в рубриках. На главной странице все прекрасно, а в рубриках появляется текст из плагина Simple Author Box, который в самом низу новостей в виде подписи автора. goo.gl/SyAcgq Quote Link to post Share on other sites
DizzeeR 19 Posted February 27, 2018 Report Share Posted February 27, 2018 Разберитесь, какой код вывода отвечает и вырезайте из шаблона. Обычно можно найти в HTML какой-нибудь признак Quote Link to post Share on other sites
AmoSan 54 Posted February 27, 2018 Author Report Share Posted February 27, 2018 Какой признак может на это указывать? спасибо за совет Quote Link to post Share on other sites
DizzeeR 19 Posted February 27, 2018 Report Share Posted February 27, 2018 Давайте URL, подскажем Quote Link to post Share on other sites
AmoSan 54 Posted February 27, 2018 Author Report Share Posted February 27, 2018 1 минуту назад, DizzeeR сказал: Давайте URL, подскажем goo.gl/SyAcgq Quote Link to post Share on other sites
DizzeeR 19 Posted February 27, 2018 Report Share Posted February 27, 2018 Да, тут признаков никаких нет. Нужно смотреть шаблон рубрики (архива) на наличие лишнего кода. Можете файл выложить сюда Quote Link to post Share on other sites
petroff 647 Posted February 27, 2018 Report Share Posted February 27, 2018 В файле content.php почти в самом низу надо удалить строки <div class="teaser-footer"> <p><?php echo get_avatar(get_the_author_meta('ID'), 20); ?> <span><?php the_author(); ?> • <?php the_time(get_option('date_format')); ?></span></p> </div> Quote Link to post Share on other sites
AmoSan 54 Posted February 27, 2018 Author Report Share Posted February 27, 2018 8 минут назад, petroff сказал: В файле content.php почти в самом низу надо удалить строки <div class="teaser-footer"> <p><?php echo get_avatar(get_the_author_meta('ID'), 20); ?> <span><?php the_author(); ?> • <?php the_time(get_option('date_format')); ?></span></p> </div> Это в файле шаблона? Там нет такого когда. Внизу <?php else : ?> <div <?php post_class(); ?>> <div class="teaser"> <?php the_post_thumbnail('featured-teaser'); ?> <div class="teaser-text"> <?php $comment_count = get_comment_count($post->ID); if ($comment_count['approved'] > 0) : ?> <span class="teaser-comment-total"><?php comments_number('0', '1', '% '); ?></span> <?php endif; ?> <?php if (is_sticky()) : ?> <?php the_title('<h3 class="teaser-title"><span>★</span><a href="' . esc_url( get_permalink()) . '" rel="bookmark">', '</a></h3>'); ?> <?php else: ?> <?php the_title('<h3 class="teaser-title"><a href="' . esc_url( get_permalink()) . '" rel="bookmark">', '</a></h3>'); ?> <?php endif; ?> <?php the_excerpt(); ?> </div> </div> </div> <?php endif; ?> Quote Link to post Share on other sites
DizzeeR 19 Posted February 27, 2018 Report Share Posted February 27, 2018 выложите сюда archive.php или category.php Quote Link to post Share on other sites
AmoSan 54 Posted February 27, 2018 Author Report Share Posted February 27, 2018 1 минуту назад, DizzeeR сказал: выложите сюда archive.php или category.php В шаблоне нет таких файлов Quote Link to post Share on other sites
DizzeeR 19 Posted February 27, 2018 Report Share Posted February 27, 2018 content-page покажите Quote Link to post Share on other sites
AmoSan 54 Posted February 27, 2018 Author Report Share Posted February 27, 2018 1 минуту назад, DizzeeR сказал: content-page покажите content-page.php Quote Link to post Share on other sites
AmoSan 54 Posted February 27, 2018 Author Report Share Posted February 27, 2018 46 минут назад, DizzeeR сказал: Да, тут признаков никаких нет. Нужно смотреть шаблон рубрики (архива) на наличие лишнего кода. Можете файл выложить сюда griffin.zip Quote Link to post Share on other sites
petroff 647 Posted February 27, 2018 Report Share Posted February 27, 2018 1 час назад, AmoSan сказал: Это в файле шаблона? Там нет такого когда. Внизу <?php else : ?> <div <?php post_class(); ?>> <div class="teaser"> <?php the_post_thumbnail('featured-teaser'); ?> <div class="teaser-text"> <?php $comment_count = get_comment_count($post->ID); if ($comment_count['approved'] > 0) : ?> <span class="teaser-comment-total"><?php comments_number('0', '1', '% '); ?></span> <?php endif; ?> <?php if (is_sticky()) : ?> <?php the_title('<h3 class="teaser-title"><span>★</span><a href="' . esc_url( get_permalink()) . '" rel="bookmark">', '</a></h3>'); ?> <?php else: ?> <?php the_title('<h3 class="teaser-title"><a href="' . esc_url( get_permalink()) . '" rel="bookmark">', '</a></h3>'); ?> <?php endif; ?> <?php the_excerpt(); ?> </div> </div> </div> <?php endif; ?> Да это в файле content.php, но это не то. Так в шаблоне категории выводится автор и дата, у Вас это уже удалено. Какой плагин используется? Quote Link to post Share on other sites
AmoSan 54 Posted February 27, 2018 Author Report Share Posted February 27, 2018 Только что, petroff сказал: Да это в файле content.php, но это не то. Так в шаблоне категории выводится автор и дата, у Вас это уже удалено. Какой плагин используется? Simple Author Box Quote Link to post Share on other sites
petroff 647 Posted February 27, 2018 Report Share Posted February 27, 2018 Файл functions.php (/wp-content/plugins/simple-author-box/inc/) Меняем $show = ( is_single() || is_author() || is_archive() ); на $show = ( is_single() || is_author() ); Quote Link to post Share on other sites
AmoSan 54 Posted February 27, 2018 Author Report Share Posted February 27, 2018 Проблема решена. Всем большое спасибо за помощь. Ответила служба поддержки плагина, выслала патч. Quote Link to post Share on other sites
VIP campusboy 912 Posted February 27, 2018 VIP Report Share Posted February 27, 2018 4 минуты назад, petroff сказал: Файл functions.php (/wp-content/plugins/simple-author-box/inc/) Меняем $show = ( is_single() || is_author() || is_archive() ); на $show = ( is_single() || is_author() ); Меняем и забываем про обновления :-) Или каждый раз после обновления редактируем. Для этого следующей строчкой идёт фильтр: $show = apply_filters( 'sabox_check_if_show', $show ); Авторы плагина это предусмотрели. Остаётся лишь в functions.php темы или отдельно плагином подключиться к хуку и сделать как нам надо, то есть: add_filter( 'sabox_check_if_show', 'sabox_check_if_show_archive' ); function sabox_check_if_show_archive( $show ) { return is_archive() ? false : $show; } petroff 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.