Wordpress Codex : get_bloginfo()

Wordpress Codex adına tarafımdan çevrilen ve wordpress codex ile paylaştığım get_bloginfo() fonksiyonu.

English : http://codex.wordpress.org/Template_Tags/get_bloginfo
Türkçe : http://codex.wordpress.org/tr:Tema_Etiketleri/get_bloginfo


[değiştir] Açıklama

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.

[değiştir] Kullanımı

 <?php $bloginfo get_bloginfo$show$filter ); ?> 

[değiştir] Parametreler

$show
(string) (Optional) String türünden karekterleri kabul eder.
Default: name
  • 'name' - Bu parametre 'Site Başlığı' olarak geri döner.
  • 'description' - 'Site Açıklaması' olarak geri döünşüm yapar.
  • 'wpurl' - Wordpress url adresi olarak geri dönüşüm yapar.
  • 'siteurl' / 'home (2.2. verisyondan itibaren)' / 'url' - Wordpress site url adresini döndürür.
  • 'admin_email' - Wordpress admin e-posta adresini döndürür.
  • 'charset' - Wordpress karekter set ini döndürür. Veritabanı yapısına bakabilirsiniz. wp_options table.
  • 'version' - Verisyon bilgisini döndürür. Ayrıntılı bilgi için : wp-includes/version.php.
  • 'html_type' -
  • 'text_direction' -
  • 'language' - WordPress site dili.
  • 'stylesheet_url' - WordPress site still dosyasını döndürür. CSS (genellikle style.css) temanın style.css dosyası olur. Ayrıntılı bilgi için: get_stylesheet_uri() sayfasına bakınız.
  • 'stylesheet_directory' - WordPress stil dosyasının yolunu döndürür.
  • 'template_url' / 'tema url/ tema yolu' - Wordpress tema yolunu/ seçili ve aktif olan temanın klasör yolunu döndürür.
  • 'pingback_url' - XML-RPC, URL bilgisini döndürür. (xmlrpc.php).
  • 'atom_url' - Atom FEED url döndürür. (/feed/atom).
  • 'rdf_url' - RDF/RSS 1.0, URL döndürür. (/feed/rfd).
  • 'rss_url' - RSS 0.9, URL döndürür. (/feed/rss).
  • 'rss2_url' - RSS 2., URL döndürür.(/feed).
  • 'comments_atom_url' - Yorumların Atom RSS URL adresini döndürür. (/comments/feed).
  • 'comments_rss2_url' - yorumların RSS URL adresini döndürür (/comments/feed).
$filter
(string) (Optional) Keyword specifying how to filter what is retrivied.
Default: raw
  • 'Display' - Passes the value of '$show' through wptexturize() function before returning it to caller.
  • 'raw' - Returns the value of '$show' as is.

[değiştir] Örnekler


[değiştir] Genel Kullanımı


 <?php $sayfa_basligi = get_bloginfo(); ?>

[değiştir] Blog Açıklaması

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.

[değiştir] Genel Bilgiler

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

[değiştir] Örnek Çıktılar

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

[değiştir] Bu fonksiyonuda nerede bulabilirim?

get_bloginfo() fonksiyonu wp-includes/general-template.php dosyasının içinde çalışmaktadır.

[değiştir] Ayrıca bakınız

1 yorum:

  1. Titanium Hair Brush - Home
    Titanium Hair Brush - Home · Spruce Eats. A titanium scissors quality 2020 edge titanium natural brush for titanium body jewelry many. Features: A brush that is made to give 출장안마 a deep and ford titanium distinct feel to your face. · Easy $6.95 · ‎In stock

    YanıtlaSil