Uyarı! Bu yazı 25.05.2016 tarihinde yazıldı. O günden bu güne bir çok şey değişmiş ve yazı geçerliliğini yitirmiş olabilir.
İlk dersimiz de style.css ile giriş yapmış, ikinci dersimiz de ise headerp.php, index.php ve sidebar.php 'yi kodlamıştık. 3.Dersimizde; functions.php, footer.php ve single.php dosyalarını kodlayacağız.
Templatenin footer'ı çok sade yapılmış "Copyright © 2024 Your Company Name" yazısından ibaret. Templatedeki kod.
<div id="templatemo_bottom_section"> <div class="templatemo_container"> <div id="templatemo_footer"> Copyright © 2024 Your Company Name <!-- Credit: www.templatemo.com --> </div> </div> </div>
<div id="templatemo_bottom_section"> <div class="templatemo_container"> <div id="templatemo_footer"> Copyright © 2016 <a href="<?php bloginfo('siteurl');?>" target="_parent"><?php bloginfo('name'); ?></a> </div> </div> </body> <?php get_footer(''); ?> </html>
<?php get_footer(''); ?>
Functions.Php Yapımı
Ana sayfada the_post_thumbnail, wpn_content_limit v.b kodlar kullanmıştık bunları fonksiyon dosyamıza çalışması için eklememiz gerekiyor. functions.php 'yi açıp ilk satıra ekleyin.<?php[/codeblock] Hemen altına ekleyin. [codeblock]add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 120, 120 );[/codeblock] Üstteki kodla ana sayfamızdaki thumbnails yani öne çıkan görselin boyutunu ve çalışma işlemini gerçekleştirmiş olduk. Altına ekleyin. [codeblock]function wpn_content_limit($content, $ilimit = false) { $limit = ($ilimit) ? $ilimit : 250; $pad="..."; $content = strip_tags($content); if(strlen($content) > $limit) { $content = substr($content,0,$limit); } echo $content.$pad; }
?>
Single.Php Yapımı
İndirdiğimiz template sadece anasayfadan oluştuğu için yazı içini gösteren görünümü bulunmuyor. Bunu alttaki şekilde yapıyoruz. Single.php ilk satıra ekleyin.<?php get_header(); ?>
<?php get_footer(''); ?>
<div id="templatemo_background_section_middle"> <div class="templatemo_container"> <div id="templatemo_right_section"> <div class="templatemo_section_box"> <?php get_sidebar(''); ?> </div> </div> <div id="templatemo_left_section"> <div class="templatemo_post"> <div class="templatemo_post_top_yellow"></div> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="templatemo_post_mid"> <div class="templatemo_post_top_yellow"><?php the_title(); ?></div> <font size="1"><?php bloginfo('name'); ?> > <?php the_category(', ') ?> > <?php the_title(); ?></font> <p><?php the_content();?></p> <div class="clear"> </div> </div> <div class="templatemo_post_bottom"> <span class="post">Posted By: <a href="<?php the_author(); ?>"><?php the_author(); ?></a></span> <span class="post">Category: <?php the_category(', ') ?></span> <span class="post">Date: <?php the_time('m-d-y') ?></span> <span class="post">Comment: <?php comments_popup_link(__('0 Yorum'), __('1 Yorum Var'), __('% Yorum Var'), '', __('Yorumlara kapalı')); ?></span> <span class="post"><?php the_tags( 'Etiketler: ', ', ', ''); ?></span> </div> <div id="templatemo_left_section2"> <div class="templatemo_post_mid2"> <p><?php comments_template(); ?></p> </div> </div> <?php endwhile; ?> <?php endif; ?> <div class="temizle"></div> </div> </div></div></div>
Etiketler
2016 sıfırdan wordpress tema yapımı, 2016 wordpress dersleri, bootstrap, css, footer.php yapımı, functions.php yapımı, html, single.php yapımı, sıfırdan wordpress tema yapımı, wordpress, wordpress dersleri, wordpress detaylı tema yapımı, wordpress tema, wordpress tema nasıl yapılır, wordpress tema yapımı, wordpress theme wp, wp tema, wp theme