Codex tools: Log in
Languages: English • 日本語 • Português do Brasil • Türkçe • (Add your language)
Contents |
get_bloginfo() Bu fonksiyon sayesinde wordpress tema yapımcıları bir çok işleyişten faydanalancaktırlar. Wordpress sitenizin genel bilgilerini bu fonksiyon ile çekebilirsiniz. Az kod yazarak çok iş yapmış olacağız. Bu fonksiyon site adi, site adresi, site açıklaması gibi temel bilgileri kullanmamıza yardımcı olur.
<?php $bloginfo = get_bloginfo( $show, $filter ); ?>
wp-includes/version.php.
<?php $sayfa_basligi = get_bloginfo(); ?>
Kullanım örneği:
<?php echo 'Blog açıklaması: ' . get_bloginfo ( 'description' ); ?><br />
Aşağıdaki çıktı ile karşılaşabilirsiniz.
Bir Başka WordPress Sitesi.
Aşağıdaki örnek ile get_bloginfo() fonksiyonun kullanımını biraz daha kafamızda canlandırabiliriz.
<?php switch_to_blog(1); $site_baslik = get_bloginfo( 'name' ); $site_url = network_site_url( '/' ); $site_aciklama = get_bloginfo( 'description' ); restore_current_blog(); echo 'Site URL: ' . $site_url; echo 'Site Adı: ' . $site_baslik; echo 'Site Açıklama: ' . $site_aciklama; ?>
aşağıdaki çıktı ile karşılaşabilirsiniz.
Site URL: http://example.com/ Site Adı: WordPress Site Başlık: Bir başka wordpress sitesi
Parametreler ve parmetrelerin kullanımı ile dönen değerler. Bu veriler sitenizedeki bilgilere göre değişmektedir.
admin_email = admin@example.com atom_url = http://www.example.com/home/feed/atom charset = UTF-8 comments_atom_url = http://www.example.com/home/comments/feed/atom comments_rss2_url = http://www.example.com/home/comments/feed description = Just another WordPress blog home = http://www.example.com/home html_type = text/html language = en-US name = Testpilot pingback_url = http://www.example.com/home/wp/xmlrpc.php rdf_url = http://www.example.com/home/feed/rdf rss2_url = http://www.example.com/home/feed rss_url = http://www.example.com/home/feed/rss siteurl = http://www.example.com/home stylesheet_directory = http://www.example.com/home/wp/wp-content/themes/largo stylesheet_url = http://www.example.com/home/wp/wp-content/themes/largo/style.css template_directory = http://www.example.com/home/wp/wp-content/themes/largo template_url = http://www.example.com/home/wp/wp-content/themes/largo text_direction = ltr url = http://www.example.com/home version = 2.7 wpurl = http://www.example.com/home/wp
get_bloginfo() fonksiyonu wp-includes/general-template.php dosyasının içinde çalışmaktadır.