WordPress – İlgili Konuları Gösterme
Etiketler için; (single.php’ ye ekliyoruz..)
|
$tags = wp_get_post_tags($post->ID); |
|
foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id; |
|
'post__not_in' => array($post->ID), |
|
'showposts'=>5, // Gösterilecek benzer yazı sayısı |
|
$my_query = new wp_query($args); |
|
if( $my_query->have_posts() ) { |
|
echo '<h3>Benzer yazılar</h3><ul>'; |
|
while ($my_query->have_posts()) { |
|
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li> |
Kategoriler için; (single.php’ ye ekliyoruz.)
|
$categories = get_the_category($post->ID); |
05 |
foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id; |
|
'category__in' => $category_ids, |
|
'post__not_in' => array($post->ID), |
|
'showposts'=>5, // Gösterilecek benzer yazı sayısı |
|
$my_query = new wp_query($args); |
|
if( $my_query->have_posts() ) { |
|
echo '<h3>Benzer yazılar</h3><ul>'; |
|
while ($my_query->have_posts()) { |
|
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li> |
?>
Get Updates
Subscribe to our e-mail newsletter to receive updates.
Share This Post
Hakan Aytaş
'86 Mersin doğumlu. 4 yıldır kendi işinde reklamcılıkla uğraşıyor. Web tasarım ve grafik üzerine çalışmalar yapmaktadır. Sosyal medyanın ülkemizde yaygın hale gelmesinden ve sektör haline dönüşmesini fırsat bilerek çalışmalarına yansıtmaktadır. İnternet, bilişim, televizyon ve sinema dünyasıyla pek haşır neşir olduğundan edindiği gerekli ve gereksiz tüm bilgiyi 2yıldır festikan.com' da sizlerle paylaşıyor.
[...] This post was mentioned on Twitter by Kurtuluş Bozkurt and Hakan Aytaş, Hayta. Hayta said: WordPress – İlgili Konuları Gösterme http://bit.ly/cHPE8l [...]