Помощник
|
noindex sidebar |
vipsol1n
|
Сообщение
#1
|
||
|
|
||
|
|||
Missofking |
29.11.2014, 12:38;
Ответить: Missofking
Сообщение
#2
|
|
vipsol1n, я вот так делала)
Код <?php
if (!is_front_page()) { $noindex_1 = '<!--noindex-->'; $noindex_2 = '<!--/noindex-->'; } else $noindex_1 = $noindex_2 = ''; echo $noindex_1; ?> <div class="sidebar_title">Свежие записи</div> <div class="svezhiye"> <ul> <?php query_posts('post_type="post"&post_status="publish"&showposts=5'); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <li> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail(array(150,150), array('class' => 'alignleft')); ?></a> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> </li> <?php endwhile; ?> <?php endif; ?> <?php wp_reset_query(); ?> </ul> </div> <?php echo $noindex_2 ?> Сообщение отредактировал Missofking - 29.11.2014, 12:52 -------------------- |
|
|
vipsol1n
|
Сообщение
#3
|
|
Missofking, А как это сделать с nofollow
|
|
|
Robust |
30.11.2014, 13:00;
Ответить: Robust
Сообщение
#4
|
|
|
Попробуйте как-то так
Код <?php $num_post=0; if ( have_posts() ) : while ( have_posts() ) : the_post(); $num_post++; if($num_post<5) {$nof="";}else{$nof="rel=\"nofollow\"";} ?> <li> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" <?php echo $nof;?>><?php the_post_thumbnail(array(150,150), array('class' => 'alignleft')); ?></a> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" <?php echo $nof;?>><?php the_title(); ?></a> </li> <?php endwhile; ?> $num_post<5 - Это число постов, к которым nofollow Не применяется. Писал на коленке, возможна ошибка. Если что - пишите сюда, помогу
|
|
|
||
|
Похожие темы
Тема | Ответов | Автор | Просмотров | Последний ответ | |
---|---|---|---|---|---|
Нужно ли закрывать ненужные страницы тегом noindex, follow? | 8 | noviktamw | 2918 | 2.3.2024, 12:53 автор: toplinks |
|
Яндекс.дзен: найду публикации на вашем канале с noindex | 5 | Zhezkazganetcs | 3572 | 27.5.2019, 13:39 автор: Андрей_WPM |
|
Помогите пожалуйста форумчани, снести sidebar.php на теме Wordpress | 5 | Nonsense1987 | 9312 | 13.1.2017, 15:22 автор: -vasian7474- |
|
Размещу ваши статьи бесплатно. Линки без всяких Nofollow и Noindex. | 36 | Пивной_Энтузиаст | 17136 | 10.12.2010, 17:30 автор: lostguk |
|
помогите с sidebar | 0 | Negatiff | 5774 | 7.12.2010, 19:09 автор: -Wabfad- |
Текстовая версия | Сейчас: 26.4.2024, 7:21 |