• 07-12-2008, 01:04:49
    #1
    // 09.09.09 18.20 en kısa sürede yep yeni kodlar burada olacak.

    Son Eklenen Konular
    <?php wp_get_archives('type=postbypost&limit=15'); ?>
    Kategoriler
    <?php wp_list_cats(); ?>
    Yorumlar
    <?php
        global $wpdb;
        $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID,
        comment_post_ID, comment_author, comment_date_gmt, comment_approved,
        comment_type,comment_author_url,
        SUBSTRING(comment_content,1,30) AS com_excerpt
        FROM $wpdb->comments
        LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID =
        $wpdb->posts.ID)
        WHERE comment_approved = '1' AND comment_type = '' AND
        post_password = ''
        ORDER BY comment_date_gmt DESC
        LIMIT 10";
        $comments = $wpdb->get_results($sql);
        $output = $pre_HTML;
        $output .= "\n<ul>";
        foreach ($comments as $comment) {
        $output .= "\n<li>".strip_tags($comment->comment_author)
        .":" . "<a href=\"" . get_permalink($comment->ID) .
        "#comment-" . $comment->comment_ID . "\" title=\"on " .
        $comment->post_title . "\">" . strip_tags($comment->com_excerpt)
        ."</a></li>";
        }
        $output .= "\n</ul>";
        $output .= $post_HTML;
        echo $output;?>
    Etiketler (Tag Cloud)
    <?php wp_tag_cloud('smallest=8&largest=20'); ?>
    Bağlantılar
    <?php get_links_list(); ?>
    Aylık Arşiv
    <?php wp_get_archives('type=monthly'); ?>
    Yıllık Arşiv
    <?php wp_get_archives('type=yearly'); ?>
    Sayfalar
    <?php wp_list_pages('title_li=<h2>Son Sayfalar</h2>'); ?>
    Değişen Etiket Bulutu
    <?php wp_tag_cloud('smallest=11&largest=25&unit=px&number=50&format=flat&orderby=count&order=RAND'); ?>
    Benzer Yazılar
    <?php
    $this_post = $post;
    $category = get_the_category(); $category = $category[0]; $category = $category->cat_ID;
    $posts = get_posts('numberposts=4&offset=0&orderby=post_date&order=DESC&category='.$category);
    $count = 0;
    foreach ( $posts as $post ) {
    if ( $post->ID == $this_post->ID || $count == 5) {
    unset($posts[$count]);
    }else{
    $count ++;
    }
    }
    ?>
    <?php if ( $posts ) : ?>
    <ul>
    <?php function getWords($text, $limit) {
    $array = explode(" ", $text, $limit +1);
    if(count($array) > $limit) {
    unset($array[$limit]);
    }
    return implode(" ", $array); }
    ?>
    <?php foreach ( $posts as $post ) : ?>
    <?php $mycontent = strip_tags($post->post_content);
    $excerpt = getWords($mycontent, 15);
    $a_title = $excerpt . "..."; ?>
    <li><a href="<?php the_permalink(); ?>" title="<?php echo $a_title ?>">
    <?php if ( get_the_title() ) { the_title(); } else { echo "Untitle"; } ?></a>
    <?php endforeach // $posts as $post ?>
    </ul>
    <?php endif // $posts ?>
    <?php
    $post = $this_post;
    unset($this_post);
    ?>
    ****************
    Yazı Gösterim Sayfasında Önceki ve Sonraki Yazıya Bağlantı İçin
    single.php'de bul
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    altına yapıştır.
    		<div class="navigation">
    			<div class="alignleft"><?php previous_post_link('&laquo; %link') ?></div>
    			<div class="alignright"><?php next_post_link('%link &raquo;') ?></div>
    		</div>
    bunlarıda css'e ekle.(css renklerinizi kendinize göre ayarlayabilirsiniz.
    .navigation {
    	width: 500px;
    	height: 20px;
    	margin-bottom: 10px;
    	font-size: 9px;
    	font-weight: bold;
    	color: #FFFFFF;
    }
    .navigation a {
    	color: #FFFFFF;
    }
    .navigation .alignleft {
    	float: left;
    }
    .navigation .alignright {
    	float: right;
    }
    ********************
    Özel alan kullanımı
    bu kodlar temanızda özel alan kullanarak yazı,mp3,resim kullanımını sağlıyor.
    örneğin bi' müzik siteniz var ve her seferinde media player kodlarını kullanmaktan bıktınız.Buna çözüm sağlıyor.
    <?php $key = "muzik";  
    $getir = get_post_meta($post->ID, $key, true); 
    if($getir != "") { ?> 
    <object id="mediaPlayer"   
    width="320"   
    height="300"  
    classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"   
    codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"   
    standby="Microsoft Windows Media Player bilesenleri yukleniyor.."  
    type="application/x-oleobject">   
    <param name="FileName" VALUE="<?php echo $getir; ?>">   
    <param name="ShowControls" value="1">  
    <param name="AutoStart" value="0">  
    <param name="ShowDisplay" value="False">  
    <param name="AutoRewind" value="0">  
    <param name="PlayCount" value="3">  
    <param name="ShowStatusBar" value="1">  
    <param name="ShowGotoBar" value="0">  
    <param name="AutoSize" value="0">  
    <param name="EnableContextMenu" value="false">  
    <param name="BorderStyle" VALUE="1">  
    <param name="DisplayForeColor" VALUE="0">  
    <param name="DisplayBackColor" VALUE="0">  
    <embed type="application/x-mplayer2"   
    pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"   
    filename="<?php echo $getir; ?>"   
    src="<?php echo $getir; ?>"   
    name="mediaPlayer"   
    autostart=0  
    showcontrols=1  
    showdisplay=False  
    showgotobar=0  
    enablecontextmenu=false  
    showstatusbar=1  
    autosize="0"   
    width="320" height="300">   
    </embed>   
    </object> 
    <?php } ?>
    üstteki kodları alıp,temanızın index.php dosyasındaki <?php the_content('Yazının tamamını okuyun &raquo;'); ?> kodunun altına yapıştırıyoruz ve olay tamam.O kadar çok kodu her seferinde eklemiyeceksiniz artık.
    Eklemek nasıl olacak?

    Görünüm nasıl olacak?
    Default temadaki görünümü..

    ******************
    En Çok Yorum Alan Yazılar.
    <strong>En Çok İlgi Çeken Yazılar:</strong>
    <ul id="moostick">
    <?php 
    $result = $wpdb->get_results("SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 5");
    foreach ($result as $topten) {
    $postid = $topten->ID;
    $title = $topten->post_title;
    $commentcount = $topten->comment_count; 
    if ($commentcount != 0) { ?>
    <li><a href="<?php echo get_permalink($postid); ?>" title="<?php echo $title ?>"><?php echo $title ?> &raquo; <span><?php echo $commentcount; ?> yorum aldı.</span></a></li>
    <?php } } ?> 
    </ul>
    Sayfaları rakamlı olarak gösterme
    Eklentiyi buradan indiriyoruz.
    Daha sonra siteye attıktan sonra etkinleştiriyoruz ve alttaki kodu istediğimiz bi' yere koyuyoruz.
    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
    Görünüm

    /Son Güncelleme: 12.12.2008 23:03
  • 07-12-2008, 01:52:30
    #2
    <?php wp_list_cats(); ?>
    bu bende çalışmadı bi türlü.sidebara ekledim ama kategoriler yazı halinde görünüyor.Çerçevesiz felan.Benmi yanlış yapıyorum.
  • 07-12-2008, 02:03:02
    #3
    ekolforum adlı üyeden alıntı: mesajı görüntüle
    <?php wp_list_cats(); ?>
    bu bende çalışmadı bi türlü.sidebara ekledim ama kategoriler yazı halinde görünüyor.Çerçevesiz felan.Benmi yanlış yapıyorum.
    <h3>kategoriler</h3>
    <ul>
    <?php wp_list_cats(); ?>
    </ul>

    böyle dene bi'de
  • 07-12-2008, 02:12:13
    #4
    codex.wordpress bakarsanız eğer
    <?php wp_list_cats(); ?>
    kodunun yanında deprecated yazar. Yani wordpress 2.1 sistemiyle gelmiştir.

    bu kodun yerine:
    <?php wp_list_categories(); ?>
    kullanmanızı tavsiye ederim. Wordpress 2.5 sürümü ile gelmiştir.
  • 07-12-2008, 02:16:21
    #5
    kategoriler

    • Amatör
    • Araçlar
    • Fragman
    • Haber
    • Kazalar
    • Komik
    • Müzik
    • Oyun
    • Sinema
    • Spor

    Kategoriler aynı bu büyüklükte bu yazı fontunda görünüyor.Neyse senin konuyu dağıtmıyim ben.Teşekkürler.
  • 07-12-2008, 02:23:57
    #6
    ekolforum adlı üyeden alıntı: mesajı görüntüle
    kategoriler
    • Amatör
    • Araçlar
    • Fragman
    • Haber
    • Kazalar
    • Komik
    • Müzik
    • Oyun
    • Sinema
    • Spor
    Kategoriler aynı bu büyüklükte bu yazı fontunda görünüyor.Neyse senin konuyu dağıtmıyim ben.Teşekkürler.
    bu konuda bunun için zaten.herkes sorsunki işe yarasın konu
    css'den ayar çekeceksin şimdide.büyük ihtimal kafamdaki gibidir.
    css'de en alta ekle
    #sidebar {
    float: right;
    color: #84878E;
    }
    #sidebar ul li a:link, .sidebar-box ul li a:visited, .sidebar-box ul li a:active {
    color: #373434; 
    } 
    #sidebar ul li {
    color: #373434;
    margin: 5px 3px 3px 5px; 
    }
    #sidebar ul {
    list-style-image: url(images/bullet.gif); 
    }
    bu resmide images'e at.bi dene bakalım nasıl olcak
  • 07-12-2008, 10:11:23
    #8
    kategoriler
    • Amatör
    • Araçlar
    • Fragman
    • Haber
    • Kazalar
    • Komik
    • Müzik
    • Oyun
    • Sinema
    • Spor
    Peki buradaki Kategoriler yazısını tamamen kaldırabilir miyiz? Gerisi aynı kalsın.
  • 07-12-2008, 11:52:22
    #9
    değişken etiket bulutu

    <?php wp_tag_cloud('smallest=11&largest=25&unit=px&number=50&format=flat&orderby=count&order=RAND'); ?>


    benzer yazılar

    <?php
    $this_post = $post;
    $category = get_the_category(); $category = $category[0]; $category = $category->cat_ID;
    $posts = get_posts('numberposts=4&offset=0&orderby=post_date&order=DESC&category='.$category);
    $count = 0;
    foreach ( $posts as $post ) {
    if ( $post->ID == $this_post->ID || $count == 5) {
    unset($posts[$count]);
    }else{
    $count ++;
    }
    }
    ?>
    <?php if ( $posts ) : ?>
    <ul>
    <?php function getWords($text, $limit) {
    $array = explode(" ", $text, $limit +1);
    if(count($array) > $limit) {
    unset($array[$limit]);
    }
    return implode(" ", $array); }
    ?>
    <?php foreach ( $posts as $post ) : ?>
    <?php $mycontent = strip_tags($post->post_content);
    $excerpt = getWords($mycontent, 15);
    $a_title = $excerpt . "..."; ?>
    <li><a href="<?php the_permalink(); ?>" title="<?php echo $a_title ?>">
    <?php if ( get_the_title() ) { the_title(); } else { echo "Untitle"; } ?></a>
    <?php endforeach // $posts as $post ?>
    </ul>
    <?php endif // $posts ?>
    <?php
    $post = $this_post;
    unset($this_post);
    ?>