Jump to content

Помогите убрать лишний текст из превью в рубриках WP


Recommended Posts

Помогите пожалуйста убрать лишний текст из превью новости в рубриках. На главной странице все прекрасно, а в рубриках появляется текст из плагина Simple Author Box, который в самом низу новостей в виде подписи автора.

goo.gl/SyAcgq

 

В рубрике.jpg

На главной.jpg

9999999999.jpg

Link to post
Share on other sites

В файле content.php почти в самом низу надо удалить строки

<div class="teaser-footer">
			<p><?php echo get_avatar(get_the_author_meta('ID'), 20); ?> <span><?php the_author(); ?> &bull; <?php the_time(get_option('date_format')); ?></span></p>			
		</div>

 

Link to post
Share on other sites
8 минут назад, petroff сказал:

В файле content.php почти в самом низу надо удалить строки


<div class="teaser-footer">
			<p><?php echo get_avatar(get_the_author_meta('ID'), 20); ?> <span><?php the_author(); ?> &bull; <?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>&bigstar;</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; ?>

 

Link to post
Share on other sites
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>&bigstar;</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, но это не то. Так в шаблоне категории выводится автор и дата, у Вас это уже удалено. Какой плагин используется?

Link to post
Share on other sites
Только что, petroff сказал:

Да это в файле content.php, но это не то. Так в шаблоне категории выводится автор и дата, у Вас это уже удалено. Какой плагин используется?

Simple Author Box

Link to post
Share on other sites
  • VIP
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;
}

 

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...