• Решено f259906

    (@micaelangelo)


    Есть код, извините что целиком, не могу убрать тайтл в строке <div class=»date»>Добавлено <?php the_time(‘j F Y’); ?> года <?php comments_popup_link( ‘Комментарии отсутствуют’, ‘1 комментарий’, ‘% комментария(ев)’); ?></div>, в этой строке выдает тайтл типа — Комментарий к записи «далее название записи в блоге», как мне убрать этот тайтл или изменить, нигде не могу найти… 🙁

    <?php get_header(); ?>
    
    	<div id="columns">
    		<div id="centercol">
    			<div class="box">
    				<div class="top"></div>
    				<div class="spacer">
    
    					<?php if(have_posts()) : ?>
    
    					<?php while(have_posts()) : the_post() ?>
    
                        <div id="post-<?php the_ID(); ?>" class="post">
    
    						<?php $category = get_the_category(); // To show only 1 Category ?>
                            <div class="btn-cat"><span class="btn-general"><?php the_category(","); ?></span></div>
    
                            <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                            <div class="date">Добавлено <?php the_time('j F Y'); ?> года <?php comments_popup_link( 'Комментарии отсутствуют', '1 комментарий', '% комментария(ев)'); ?></div>
    
    						<?php if ( get_option('woo_the_content') ) { the_content('<div class="btn-continue">Подробнее...</div>'); } else { the_excerpt(); ?>
                            <div class="btn-continue"><a href="<?php the_permalink() ?>">Подробнее...</a></div>
                            <?php } ?>
    
                        	<div class="fix"></div>
                        </div>
                        <!--/post-->                            
    
                        <?php endwhile; ?>
    <?php if(function_exists('wp_paginator')) { wp_paginator(); } ?>
    					<!-- <div class="btn-arr fr"><?php next_posts_link('Вперед &raquo;') ?></div>
    					<div class="btn-arr f1"><?php previous_posts_link('&laquo; Назад') ?></div> -->
    					<br class="fix" />
    
                        <?php endif; ?>
    
    				</div>
    				<!--/spacer -->
    				<div class="bot"></div>
    			</div>
    			<!--/box -->
    		</div>
    		<!--/centercol -->
    
    <?php get_sidebar(); ?>
    
    		<br class="fix" />
    	</div>
    	<!--/columns -->
    
    <?php get_footer(); ?>
Просмотр 2 ответов — с 1 по 2 (всего 2)
  • Модератор Sergey Biryukov

    (@sergeybiryukov)

    Live and Learn

    Не самый элегантный, но наверное, самый простой способ — продублировать большую часть comments_popup_link() в файле functions.php активной темы:

    function my_comments_popup_link( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $css_class = '', $none = 'Comments Off' ) {
    	global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post;
    
    	if ( is_single() || is_page() )
    		return;
    
    	$number = get_comments_number( $id );
    
    	if ( 0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status ) {
    		echo '<span' . ((!empty($css_class)) ? ' class="' . $css_class . '"' : '') . '>' . $none . '</span>';
    		return;
    	}
    
    	if ( post_password_required() ) {
    		echo __('Enter your password to view comments');
    		return;
    	}
    
    	echo '<a href="';
    	if ( 0 == $number )
    		echo get_permalink() . '#respond';
    	else
    		comments_link();
    	echo '"';
    
    	if ( !empty( $css_class ) ) {
    		echo ' class="'.$css_class.'" ';
    	}
    
    	echo apply_filters( 'comments_popup_link_attributes', '' );
    
    	echo '>';
    	comments_number( $zero, $one, $more, $number );
    	echo '</a>';
    }

    и использовать my_comments_popup_link() вместо стандартной функции.

    Автор f259906

    (@micaelangelo)

    Огромное спасибо!

Просмотр 2 ответов — с 1 по 2 (всего 2)
  • Тема «Убрать тайтл» закрыта для новых ответов.