Tema Kodları etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
Tema Kodları etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

19 Şubat 2017 Pazar

WordPress Kod Arşivi

WordPress tema yapımı oldukça basittir genel olarak birkaç şablondan oluşmaktadır bunların bağzıları ise header, sidebar, footer, content ve single gibi sayfaları mevcuttur aşağıdaki yer alan kodlar ile bu sayfaları yapabilirsiniz.

Tema yaparken aşağıdaki kodlar işinizi görecektir, ancak yetersiz kaldığı durumda wordpressin kendi kod arşivinden yararlanabilirsiniz : https://codex.wordpress.org/


Wordpress Versiyonunu Çekmek ;
<?php bloginfo('version'); ?>


Wordpress Atom Adreslerini Çekmek ;
<?php bloginfo('atom_url'); ?>


Wordpress RSS Adresi Çekmek ;
<?php bloginfo('rss2_url'); ?>


Wordpress Karakter Kodlaması Çekmek ;
<?php bloginfo('charset'); ?>


Wordpress Karakter Kodlaması Çekmek ;
<?php bloginfo('charset'); ?>


Wordpress Blog Adı Çekmek ;
<?php bloginfo('name'); ?>


Wordpress Açıklaması Çekmek ;
<?php bloginfo('description'); ?>


Wordpress Blog URL Çekmek ;
<?php bloginfo('url'); ?>


Wordpress Blog URL Çekmek ;
<?php bloginfo('url'); ?>


Wordpress Stil Dosyası Çekmek ;
<?php bloginfo('stylesheet_url'); ?>


Wordpress Tema Yolu Çekmek ;
<?php bloginfo('template_url'); ?>


Wordpress Header.php Çapırmak ;
<?php get_header(''); ?>


Wordpress Sidebar.php Çapırmak ;
<?php get_sidebar(''); ?>


Wordpress Footer.php Çapırmak ;
<?php get_footer(''); ?>


Wordpress Kategorileri Listelemek ;
<?php wp_list_cats('title_li='); ?>


Wordpress Sayfaları Listeletmek ;
<?php wp_list_pages('title_li='); ?>


Wordpress Takvimi Çağırmak ;
<?php get_calendar(''); ?>


Wordpress Arşivleri Listelemek ;
<?php wp_get_archives('') ?>


Wordpress Son Yorumları Listelemek; ;
<?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;
?>


Wordpress While (Konu çekme döngüsü) ;
[php 1="if" 2="(have_posts())" 3=":" 4="while" 5="(have_posts())" 6=":" 7="the_post();" 8="?>Çekilecek" 9="" 10="endwhile;else" 11=":" 12="?>[/php" language=""]

<strong>Wordpress Yazı Başlığını Çekmek ;</strong>
<?php the_title(''); ?>


Wordpress Yazı URL Çekmek ;
<?php the_permalink('') ?>


Wordpress Yazı Kategorisi Çekmek ;
<?php the_category(', ') ?>


Wordpress Yazı Tarihi Çekmek ;
<?php the_time('j F Y'); ?>


Wordpress Yazı İçeriği Çekmek ;
<?php the_content(''); ?>


Wordpress Yazının Yayınladığı Saati Çekmek ;
<?php the_time('H:i:s'); ?>


Wordpress Yazıya Yapılan Yorumların Sayfası ;
<?php comments_popup_link(__('Yorum yapılmamış,ilk yorumu senyap :)'), __('1 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
<?php if(function_exists('the_views')) { the_views(); } ?>


Wordpress Yazı Düzenleme Linki (Sadece Adminlerde Çalışır)
<?php edit_post_link(); ?>


Wordpress Yorum Şablonu Çekme ;
<?php comments_template(); ?>


Wordpress Yazar Adı Çekme ;
<?php the_author(''); ?>


Wordpress Yazar Hakkında Çekme ;
<?php the_author_description(''); ?>


Wordpress Yazar İsmi Çekme ; ;
<?php the_author_description(''); ?>


Wordpress Yazar Soy İsmi Çekme ; ;
<?php the_author_lastname(''); ?>


Wordpress Yazarın Makale Sayısı Çekme ; ;
<?php the_author_posts('');?>


Wordpress Yazar Sayfası Çekme ;
<?php the_author_link('');?>


Wordpress Yazarın Websitesi URL ;
<?php the_author_url(''); ?>


Wordpress Yazarın Mail Adresi ;
<?php the_author_email('');?>


Wordpress Sonraki Yazı Linki ;
<?php next_post_link('') ?>


Wordpress Önceki Yazı Linki ;
<?php previous_post_link('') ?>


Wordpress Öne Çıkarılmış Görsel Kullanımı ;
<?php if ( has_post_thumbnail() ) {the_post_thumbnail();} else {}?>


Wordpress Öne Çıkarılmış Görsel Kullanımı ;
<?php if ( has_post_thumbnail() ) {the_post_thumbnail();} else {}?>

functions.php eklenecek
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 150, 150 );


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) ;
/*
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
*/