The Most Used WordPress Codes

You can find the most basic PHP codes that you may need frequently while integrating your own theme to the WordPress infrastructure.

Site adını gösterir.

<?php bloginfo('name'); ?>

Site açıklamasını gösterir.

<?php bloginfo(’description’); ?>

Tema adresini gösterir.

<?php bloginfo('template_url'); ?>

Site adresini gösterir.

<?php bloginfo('url'); ?>

</head> tagından önce eklenmelidir.

<?php wp_head(); ?>

</body> tagından önce eklenmelidir.

<?php wp_footer(); ?>

Yazı başlığını gösterir.

<?php the_title(); ?>

Yazı içeriğini gösterir.

<?php the_content(); ?>

Yazı içeriğini belirtilen karakter aralığında gösterir.

<?php echo mb_substr(strip_tags($post->post_content), 0, 140, "utf-8");?>

Yazı adresini gösterir.

<?php the_permalink(); ?>

Yazı görselini çağırır. (Büyük boy)

<?php the_post_thumbnail_url("large"); ?>

Kategori ID’sini gösterir.

<?php the_category_ID(); ?>

Kategori adını gösterir.

<?php single_cat_title(''); ?>

Kategori açıklamasını gösterir.

<?php echo category_description(); ?>

Yorum formunu çağırır.

<?php comments_template();  ?>

header.php’yi çağırır.

<?php get_header(); ?>

footer.php’yi çağırır.

<?php get_footer(); ?>

sidebar.php’yi çağırır.

<?php get_sidebar(); ?>

Kullanıcı avatarını gösterir.

<?php echo get_avatar( get_the_author_meta( 'ID' ), 80 ); ?>

Yazar adını gösterir.

<?php the_author_meta( 'display_name' ); ?>
<?php the_author(); ?>

Yazar biyografisini gösterir.

<?php the_author_meta( 'description' ); ?>

Etiketleri gösterir.

<?php the_tags( 'Tags: ', ', ', ''); ?>

Yorum sayısını gösterir.

<?php comments_number('0 comment', '1 comments', '% comments' );?>