Cara memasang related post berdasarkan tag pada blog wordpress tanpa plugin alias edit di folder cpanel anda.
caranya yaitu
1. Masuk cpanel
2. pilih tema anda
3. cari single .php lalu edit
4. cari / control + f tulisan atau kode ini : <?php the_content('Read the rest of this entry'); ?> dan pastekan kode dibawah ini kode kode dibawah kode tersebut.
caranya yaitu
1. Masuk cpanel
2. pilih tema anda
3. cari single .php lalu edit
4. cari / control + f tulisan atau kode ini : <?php the_content('Read the rest of this entry'); ?> dan pastekan kode dibawah ini kode kode dibawah kode tersebut.
<h3>Related Post :</h3>
<divclass="relatedpost">
<?php$this_post=$post;$category= get_the_category();$category=$category[0];$category=$category->cat_ID;$posts= get_posts('numberposts=5&offset=0&orderby=rand&order=DESC&category='.$category);$count= 0;foreach($postsas$post) {if($post->ID ==$this_post->ID ||$count== 5) {unset($posts[$count]);}else{$count++;}}?>
<?phpif($posts) : ?>
<div>
<ol>
<?phpforeach($postsas$post) : ?>
<li><a href="<?php the_permalink() ?>"target="_blank"><?phpif( get_the_title() ){ the_title(); }else{echo"No Related Post"; } ?></a></li>
<?phpendforeach// $posts as $post ?>
</ol>
</div>
</div>
<?phpendif// $posts ?>
<?php$post=$this_post;unset($this_post);?>
5. klik simpan beres dech
Sumber : http://info-menarik.net/cara-membuat-related-post-tanpa-plugin-di-wordpress/comment-page-2/#comment-1890
Ini yang saya cari. Trims infonya. Terus berkarya
BalasHapus