Navigation:  TÜYOLAR >

Basit WP kodları (Son yazı-SonYorum..)

Previous pageReturn to chapter overviewNext page

Wordpress sisteminde son yazılar, son yorumlar gibi özellikleri sitemizde görüntülemek için gereken kodlardan derlediğim örnek kodları burada alt da görebilirsiniz, resim numarası ile eşleşen kodu temanızda görünmesini istediğiniz yere örneğin genelde kullanılan sidebar.php ye yapıştırıp kaydedin, sonra site sayfanızı tazeleyerek görünüme, konumuna bakın, daha fazlası..

 

 

 

1

 

 

<h1>Son Yazılar</h1>

<div class="submenu">

       <ul>

               <?php query_posts('showposts=5'); ?>

                       <?php while (have_posts()) : the_post(); ?>

                       <li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent link to'); ?> <?php the_title(); ?>"><?php the_title(); ?></a> - <?php the_time('m-d-Y') ?></li>

               <?php endwhile;?>

       </ul>

 

 

2

 

 

<h1><?php _e(Kategoriler); ?></h1>

<div class="submenu">

    <ul>

      <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>

    </ul>

 

 

3

 

 

<h1>Sayfalar</h1>

    <ul>

      <?php wp_list_pages('title_li='); ?>

    </ul>

 

yada

 

 

<?php wp_list_pages('title_li=' . __('Sayfalar:')); ?>

 

 

4

 

 

<h2><?php _e('Son Yorumlar'); ?></h2>

 

    <?php if (function_exists('get_recent_comments')) { ?>

    <?php get_recent_comments(); ?>

    <?php } ?>

 

 

5

 

 

<?php wp_get_archives('type=postbypost&limit=6'); ?>

 

 

6

 

 

<h2>Arşiv</h2>

<ul class="counts">

<?php wp_get_archives('type=monthly&limit=12&show_post_count=1'); ?>

</ul>

 

 

yada

 

 

</li>

<li id="archives"><?php _e('Arşivler:'); ?>

       <ul>

        <?php wp_get_archives('type=monthly'); ?>

       </ul>

 

 

7

 

 

<h2>Takvim</h2>

<?php get_calendar(2); ?>

 

 

8

 

 

<?php wp_list_categories('title_li=' . __('Kategoriler:')); ?>

 

 

9

 

 

<h4>Yazı Bilgileri:</h4>

<div class="about-entry">

<?php the_time('j F Y l') ?> günü, <?php the_time() ?> gibi <?php the_category(', ') ?> kategorisinde  yayınlanmış, <?php comments_rss_link('RSS 2.0'); ?> ile takip edebilir, <a href="#respond">yorum bırakabilir</a> yada <a href="<?php trackback_url(display); ?>">geri izleme</a> ile siteniz üzerinden takip edebilirsiniz.

 

 

yada

 

 

                                       <small>

                                               Bu yazı

                                               <?php /* This is commented, because it requires a little adjusting sometimes.

                                                       You'll need to download this plugin, and follow the instructions:

                                                       http://binarybonsai.com/archives/2004/08/17/time-since-plugin/ */

                                                       /* $entry_datetime = abs(strtotime($post->post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */ ?>

                                               <?php the_time('l, d F Y') ?>, <?php the_time() ?> tarihinde

                                               <?php the_category(', ') ?> kategorisi altında yayınlandı.

                                               Bu yazıya yapılacak yorumlardan haberdar olmak için <?php comments_rss_link('RSS 2.0'); ?> beslemesini kullanabilirsiniz.

 

                                               <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {

                                                       // Both Comments and Pings are open ?>

                                                       <a href="#respond">Yorum yapabilirsiniz</a>, veya kendi sitenizden <a href="<?php trackback_url(); ?>" rel="trackback">geri izleme</a> yapabilirsiniz.

 

                                               <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {

                                                       // Only Pings are Open ?>

                                                       Yorum yapma şimdilik kapalı, fakat kendi sitenizden <a href="<?php trackback_url(); ?> " rel="trackback">geri izleme</a> yapabilirsiniz.

 

                                               <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {

                                                       // Comments are open, Pings are not ?>

                                                       Sona gidip yorum yapabilirsiniz. Pingleme şimdilik kapalı.

 

                                               <?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {

                                                       // Neither Comments, nor Pings are open ?>

                                                       Yorum yapma ve pingleme kapalı.

 

                                               <?php } edit_post_link('Yazıyı düzenleyin.','',''); ?>

 

                                       </small>

 

 

10

 

 

<h2><a href="<?php the_permalink() ?>" rel="kalıcı bağlantı"><?php the_title(); ?></a></h2><?php the_author(); ?> <?php the_time('j F Y'); ?> tarihinde<?php _e(","); ?> <?php the_category(',') ?> kategorisinde yazmış.

 

 

11

 

 

<?php wp_list_bookmarks('title_after=&title_before='); ?>

 

 

12

 

 

<ul>

<?php wp_register(); ?>

<li><?php wp_loginout(); ?></li>

<li><a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('RSS ile siteye abone olun'); ?>"><?php _e('<abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>

<li><a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('Yazılara yapılan son yorumlar için RSS'); ?>"><?php _e('Yorumlar <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>

<li><a href="http://validator.w3.org/check/referer" title="<?php _e('Bu sayfa XHTML 1.0 Transitional olarak geçerli'); ?>"><?php _e('Geçerli <abbr title="eXtensible HyperText Markup Language">XHTML</abbr>'); ?></a></li>

<li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>

<li><a href="http://wordpress.org/" title="<?php _e('Altyapı WordPress, kişisel yayınlama platformu.'); ?>"><abbr title="WordPress">WP</abbr></a></li>

<?php wp_meta(); ?>

</ul>

</li>

 

 

13

 

 

<li><h2><?php _e('Yönetim'); ?></h2><ul><div><?php global $user_ID, $user_identity; get_currentuserinfo(); if (!$user_ID): ?><div><form name="loginform" id="loginform" action="<?php echo get_settings('siteurl'); ?>/wp-login.php" method="post"><ul><li><?php _e('Username') ?>:<br /></li><input type="text" name="log" id="log" value="" size="22" tabindex="1" /><br /><li><?php _e('Şifre') ?>:<br /></li><input type="password" name="pwd" id="pwd" value="" size="14" tabindex="2" /><input type="submit" name="submit" value="<?php _e('Giriş'); ?>" tabindex="3" /><br /><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="4" /><?php _e('Hatırla'); ?><br /><br/> <?php wp_register('', ''); ?>.<input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>"/></ul></form></div><?php  else:?><span class="h3a"><?php echo $user_identity; ?></span><ul><li><a href="<?php echo get_settings('siteurl'); ?>/wp-admin/">Kontrol Panel</a></li><li><a href="<?php echo get_settings('siteurl'); ?>/wp-admin/post-new.php">Yazı yaz</a></li><li><a href="<?php echo get_settings('siteurl'); ?>/wp-admin/profile.php">Profil</a></li><li><a href="<?php echo get_settings('siteurl') . '/wp-login.php?action=logout&amp;redirect_to=' . $_SERVER['REQUEST_URI']; ?>"><?php _e('Çıkış'); ?></a></li></ul><?php  endif;?></div>

</ul></li>

 

 

14

 

 

<h2>Aramak istediğiniz kelimeyi girin:</h2>

<form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">

<input type="text" name="s" id="s" size="55" />

<input class=".button" type="submit" value="<?php _e('Search'); ?>" />

</form>

 

 

yada

 

 

<li id="search">

 <label for="s"><?php _e('Arama Yapın:'); ?></label>

 <form id="searchform" method="get" action="<?php bloginfo('home'); ?>">

       <div>

               <input type="text" name="s" id="s" size="15" /><br />

               <input type="submit" value="<?php _e('Ara'); ?>" />

       </div>

       </form>

</li>

 

 

15

 

 

<small><?php the_tags( '<p>Etiketler: ', ', ', '</p>'); ?></small>

 

16

 

<h3>Rastgele Etiketler</h3>

<?php wp_tag_cloud('smallest=8&largest=22&number=30&orderby=count&order=RAND'); ?>