Wordpress Kod Bankası!
Wordpress bildiğiniz üzere bedava olarak kullanıcılarına sunulan bir scripttir. Her wordpress kodlayıcısının bildiği ve olmazsa olmaz olan kodları buradan paylaşmak istedim..
Wordpress Versiyonunu Çekmek ;
Alıntı:
<?php bloginfo('version'); ?>
|
Wordpress Atom Adreslerini Çekmek ;
Alıntı:
<?php bloginfo('atom_url'); ?>
|
Wordpress RSS Adresi Çekmek ;
Alıntı:
<?php bloginfo('rss2_url'); ?>
|
Wordpress Karakter Kodlaması Çekmek ;
Alıntı:
<?php bloginfo('charset'); ?>
|
Wordpress Karakter Kodlaması Çekmek ;
Alıntı:
<?php bloginfo('charset'); ?>
|
Wordpress Blog Adı Çekmek ;
<?php bloginfo('name'); ?>
Wordpress Açıklaması Çekmek ;
Alıntı:
<?php bloginfo('description'); ?>
|
Wordpress Blog URL Çekmek ;
Alıntı:
<?php bloginfo('url'); ?>
|
Wordpress Blog URL Çekmek ;
Alıntı:
<?php bloginfo('url'); ?>
|
Wordpress Stil Dosyası Çekmek ;
Alıntı:
<?php bloginfo('stylesheet_url'); ?>
|
Wordpress Tema Yolu Çekmek ;
Alıntı:
<?php bloginfo('template_url'); ?>
|
Wordpress Header.php Çağırmak ;
Wordpress Sidebar.php Çağırmak ;
Alıntı:
<?php get_sidebar(''); ?>
|
Wordpress Footer.php Çağırmak ;
Wordpress Kategorileri Listelemek ;
Alıntı:
<?php wp_list_cats('title_li='); ?>
|
Wordpress Sayfaları Listeletmek ;
Alıntı:
<?php wp_list_pages('title_li='); ?>
|
Wordpress Takvimi Çağırmak ;
Alıntı:
<?php get_calendar(''); ?>
|
Wordpress Arşivleri Listelemek ;
Alıntı:
<?php wp_get_archives('') ?>
|
Wordpress Son Yorumları Listelemek; ;
Alıntı:
<?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,,30) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT 0";
$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;
?>
|
Wordpress While (Konu çekme döngüsü) ;
Alıntı:
[PHPR<?php if (have_posts()) : while (have_posts()) : the_post(); ?>Çekilecek Veriler<?php endwhile;else : ?>[/PHPR]
|
Wordpress Yazı Başlığını Çekmek ;
Wordpress Yazı URL Çekmek ;
Alıntı:
<?php the_permalink('') ?>
|
Wordpress Yazı Kategorisi Çekmek ;
Alıntı:
<?php the_category(', ') ?>
|
Wordpress Yazı Tarihi Çekmek ;
Alıntı:
<?php the_time('j F Y'); ?>
|
Wordpress Yazı İçeriği Çekmek ;
Alıntı:
<?php the_content(''); ?>
|
Wordpress Yazının Yayınladığı Saati Çekmek ;
Alıntı:
<?php the_time('H:i:s'); ?>
|
Wordpress Yazıya Yapılan Yorumların Sayfası ;
Alıntı:
<?php comments_popup_link(__('Yorum yapılmamış,ilk yorumu senyap :)'), __(' yorum yapılmış'), __('% yorum yapılmış')
Wordpress Sayfalama Yapmak(WP-Postviews ile ;
<?php if(function_exists('the_views')) { the_views(); } ?>
|
Wordpress Yazı İD'si Çekmek
Alıntı:
<?php if(function_exists('the_views')) { the_views(); } ?>
|
Wordpress Yazı Düzenleme Linki (Sadece Adminlerde Çalışır)
Alıntı:
<?php edit_post_link(); ?>
|
Wordpress Yorum Şablonu Çekme ;
Alıntı:
<?php comments_template(); ?>
|
Wordpress Yazar Adı Çekme ;
Wordpress Yazar Hakkında Çekme ;
Alıntı:
<?php the_author_description(''); ?>
|
Wordpress Yazar İsmi Çekme ;
Alıntı:
<?php the_author_description(''); ?>
|
Wordpress Yazar Soy İsmi Çekme ;
Alıntı:
<?php the_author_lastname(''); ?>
|
Wordpress Yazarın Makale Sayısı Çekme ;
Alıntı:
<?php the_author_posts('');?>
|
Wordpress Yazar Sayfası Çekme ;
Alıntı:
<?php the_author_link('');?>
|
Wordpress Yazarın Websitesi URL ;
Alıntı:
<?php the_author_url(''); ?>
|
Wordpress Yazarın Mail Adresi ;
Alıntı:
<?php the_author_email('');?>
|
Wordpress Sonraki Yazı Linki ;
Alıntı:
<?php next_post_link('') ?>
|
Wordpress Önceki Yazı Linki ;
Alıntı:
<?php previous_post_link('') ?>
|
Wordpress Öne Çıkarılmış Görsel Kullanımı ;
Alıntı:
<?php if ( has_post_thumbnail() ) {the_post_thumbnail();} else {}?>
|
Wordpress Öne Çıkarılmış Görsel Kullanımı ;
Alıntı:
<?php if ( has_post_thumbnail() ) {the_post_thumbnail();} else {}?>
|
functions.php eklenecek
Alıntı:
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 50, 50 );
Wordpress Arama Formu Kullanımı ;
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>">
<input class="searchbg" type="text" name="s" id="s" onfocus="if (this.value == 'Ara ...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Ara ...';}" />
<input class="button" type="button" value="" />
</form>
|
Wordpress Style Kodu (Bu kod olmazsa tema tanımlanamaz) ;
Alıntı:
/*
Theme Name: Burası Tema İsmi
Theme URI: tema sitesi
Description: Açıklama
Author: tema yapımcısı
Author URI: yapımcı url
Version: güncel tema versiyonu
*/
|
|