Log In · Register

 
Convert Layout Into Wordpress Theme
YourSuperior
post Apr 20 2008, 08:21 PM
Post #1


;)
*******

Group: Staff Alumni
Posts: 9,573
Joined: Feb 2005
Member No: 99,124



I've recently installed Word Press, and I have made and coded a layout that I would like to convert to a Word Press theme, but all of the tutorials are so confusing. Can someone help me?
 
 
Start new topic
Replies
pandora
post Apr 24 2008, 05:48 PM
Post #2


i did your boyfriend
*******

Group: Official Designer
Posts: 3,335
Joined: Feb 2004
Member No: 4,071



um try not to just take someone elses theme and tweak it for your own layout; that's... just not right.

First just code your regular website layout. Then wherever you want content to go, such as your blog entry, the date and time of your enty, the comments link, etc and look on the wordpress codex for the tag that goes with that information. for instance, the code to display the entry title is:

CODE
<?php the_title(); ?>



The easiest way to do this all is to split your layout into a header and footer, and include the header and footer in each of your templates. You will need a template for index.php, page.php, archives.php, archive.php, single.php,comments.php and a few others.

Here's an example of an index.php template; i just stripped out all the fancy stuff:

CODE
<?php get_header(); ?>

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<?php the_date('','<h2>','</h2>'); ?>

<div class="post">
     <h1><?php the_title(); ?></h1>
    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php the_tags(__('Tags: '), ', ', ' — '); ?> <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>

    <div class="storycontent">
        <?php the_content(__('(more...)')); ?>
    </div>

    <div class="feedback">
        <?php wp_link_pages(); ?>
        <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    </div>

</div>

<?php comments_template(); // Get wp-comments.php template ?>

<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>

<?php posts_nav_link(' — ', __('&laquo; Older Posts'), __('Newer Posts &raquo;')); ?>

<?php get_footer(); ?>



For more information, check out the wordpress site.



 

Posts in this topic


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: