Sebelumnya, saya berjanji akan memberikan cara pembuatan daftar isi di wordpress pada postingan saya yang berjudul Membuat Daftar isi Di Blogger. Janji tersebut telah saya tepati, seiring dipublikasikannya artikel ini. Dan kali ini kita tidak perlu mengedit file php apapun, melainkan membuat file php yang baru pada direktori theme kamu.
Langkah-langkah :
- Login ke CPANEL Hosting Kamu.
- Buka direktori theme yang kamu gunakan pada saat ini.
- Buatlah sebuah file php yang baru dengan nama sitemap.php.
- Tempelkan kode dibawah ini pada kode editor. <?php get_header(); ?>
<div id="col1">
<div id="content">
<div id="contentbox">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_title('<h2>', '</h2>'); ?>
<div class="byline"> Diposkan pada
<?php the_time('M. jS, Y') ?>
oleh <span class="author">
<?php the_author_posts_link(); ?>
</span> </div>
<div class="entry">
<h3>Navigasi</h3>
<ul>
<?php $archive_query = new WP_Query('showposts=1000');
while ($archive_query->have_posts()) : $archive_query->the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a> (<?php comments_number('0', '1', '%'); ?>)</li>
<?php endwhile; ?>
</ul>
<?php if(function_exists("get_hottopics")) : ?>
<h3>Topik Terpopuler</h3><ul><?php get_hottopics(); ?></ul>
<?php else : ?>
<?php endif; ?>
<h3>Feeds Syndicator</h3>
<ul>
<li><a href="<?php bloginfo('rdf_url'); ?>" title="RDF/RSS 1.0 feed"><acronym title="Resource Description Framework">RDF</acronym>/<acronym title="Really Simple Syndication">RSS</acronym> 1.0 feed</a></li>
<li><a href="<?php bloginfo('rss_url'); ?>" title="RSS 0.92 feed"><acronym title="Really Simple Syndication">RSS</acronym> 0.92 feed</a></li>
<li><a href="<?php bloginfo('rss2_url'); ?>" title="RSS 2.0 feed"><acronym title="Really Simple Syndication">RSS</acronym> 2.0 feed</a></li>
<li><a href="<?php bloginfo('atom_url'); ?>" title="Atom feed">Atom feed</a></li>
</ul>
</div>
<div class="clear"></div>
</div>
<!--end: entry-->
<?php endwhile; else: ?>
<?php endif; ?>
</div>
<!--end: contentbox-->
<div class="clear"></div>
</div>
<!--end: content-->
</div>
<!--end: col1-->
<?php get_sidebar(); ?>
<?php get_footer(); ?></li>
CATATAN : - Dari kode <?php get_header(); ?>.... </span> </div>
<div class="entry">
,silahkan sesuaikan dengan theme kamu. - Dari kode <div class="clear"></div>
... <?php get_footer(); ?></li>, silahkan sesuaikan dengan theme yang kamu gunakan. - Kemudian Simpan.
- Salin kode dibawah ini di Notepad.<?php include (TEMPLATEPATH . '/sitemap.php'); ?>
- Login ke Administrator WordPress Kamu.
- Buat sebuah halaman baru dengan nama Sitemap atau Daftar Isi,dll.
- Tempelkan kode yang sebelumnya telah kamu salin ke kolom Konten.
- Sekarang Klik Publish.
0 comments:
Post a Comment