WordPress.org

Ready to get started?Download WordPress

Forums

Code-Newbie Needs Pointers (5 posts)

  1. joah
    Member
    Posted 5 years ago #

    Hello Everyone,

    I have a design that i want to build into a template. It is this design:

    http://dl.getdropbox.com/u/236812/redout_ontwerp_01%20schets.jpg

    This is what i got so far: http://www.redout.nl

    I really just wanna know if I'm going about it the right way. I'm trying to make a 3 column, SEO friendly (2,1,3) layout in CSS.
    I've put the sidebar div in the content div, but i'm not sure if that is right...

    Thanks for your suggestions!

  2. joah
    Member
    Posted 5 years ago #

    Maybe I should make my question more specific:
    I have built the basic structure of my index page, which will contain "the loop". I'm just starting to grasp the loop concept, but i'm unclear on the following:

    In the default theme, a call to the sidebar is made after the loop, right before calling the footer. I think my index file has the call to the sidebar inside the loop (but i'm not sure). Is this going to be a problem??

    <body>
    	<div id="page">
        	<div id="header">
                	<a href="<?php echo get_option('home'); ?>/"><img id="headerimage" src="/wp-content/themes/redout/images/redout_logo.png"/></a>
            </div>
    <?php /*?>header end<?php */?>
    
    <?php /*?>index start<?php */?>
          <div id="container">
                <div id="content">
                    content                  <==== DOES THE LOOP GO HERE?
                </div>
                <div id="leftcol">
    <?php /*?>sidebar start<?php */?>
                 	sidebar                   <=== I PLANNED THE SIDEBAR HERE
    <?php /*?>sidebar end<?php */?>
                </div>
                <div id="rightcol">
                    rightcol
                </div>
          </div>
    <?php /*?>index end<?php */?>
    
    <?php /*?>footer start<?php */?>
            <div id="footer">
                footer
            </div>
        </div>
    </body>
    </html>
    <?php /*?>footer end<?php */?>
  3. @mercime
    Volunteer Moderator
    Posted 5 years ago #

    That's not going to work in in index.php at all. You have to learn more about converting HTML to WordPress theme.

    Another way to learn is by looking at codes of other WordPress themes and then apply your HTML markups there. I looked for a WordPress theme that's relatively simple for your edification - http://wordpress.org/extend/themes/bytetips. Another much simpler theme to study is the Classic theme that's included in basic upload of WP.

  4. joah
    Member
    Posted 5 years ago #

    The above code is not yet split into seperate header, footer, sidebar and index files. I thought i'd get the page to work as a whole first, and then split it into its template parts.

    Also, I have not yet added all the php-code that WordPress uses. I'm just trying to figure out what goes where in CSS.

    I hope this clarifies the question I'm asking, but perhaps your answer still remains the same. I'm going to take a look at the templates you mentioned now...

    In the meantime, if anyone has something to add, please do so. :)

  5. joah
    Member
    Posted 5 years ago #

    allright,

    I updated the code a bit... (?) :

    <body>
    	<div id="page">
        	<div id="header">
                	<a href="<?php echo get_option('home'); ?>/"><img id="headerimage" src="/wp-content/themes/redout/images/redout_logo.png"/></a>
            </div>
    <!-- header end -->
    
    <!-- index start -->
          <div id="container">
                <div id="content">
    
                 <!-- loop start -->
                 	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                    <a href="<?php the_permalink() ?>" rel="bookmark" title='Click to read: "<?php strip_tags(the_title()); ?>"'><?php the_title(); ?></a>
                    <?php the_content("Continue reading '" . the_title('', '', false) . "'"); ?>
                    <?php endwhile; ?>
                    <?php next_posts_link('&laquo; Older blog posts') ?> <?php previous_posts_link('&bull; Newer blog posts &raquo;') ?>
                    <?php else : ?>
     		<h2 class="center">Not Found</h2>
    		<p class="center">Sorry, but you are looking for something that isn't here.
    		?php include (TEMPLATEPATH . "/searchform.php"); ?>
    		<?php endif; ?>
                 <!-- loop end -->   
    
                </div>
                <div id="leftcol">
    <!-- index end -->
                 	sidebar
    <!-- sidebar start -->
                </div>
                <div id="rightcol">
                    rightcol
                </div>
          </div>
    <!-- sidebar end -->
    
    <!-- footer start -->
            <div id="footer">
                footer
            </div>
        </div>
    </body>
    </html>
    <!-- footer end -->

    So far, it seems to be working, and the loop is generating posts as can be seen here at my URL. I think I'm on the right track, but i'm still very weary about any mistakes i might be making, that should be recognized now, before i'm too far into the development.

Topic Closed

This topic has been closed to new replies.

About this Topic