0

I have created my first WordPress Theme from HTML and I want to add a space to the right hand side of my blog posts with profile information and links to other sites etc..

I am using the below code and it seems to repeat the table td where I would like to add the profile and other information?

Can anyone shed some light on a solution for this? To see what it looks like.

<table style="width: 1000px; height: 150px" cellspacing="0" cellpadding="0" align="center">
    <tr>
        <td style="width: 740px">    
            <table style="width: 740px" cellspacing="0" cellpadding="0" align="center">
                <tr>
                    <td style="width: 200px; height: 44px" background='Date.jpg'>
                        <h2>
                        <?php the_time('F jS, Y'); ?>
                    </h2>
                </td>
                <td style="width: 540px; height: 44px" background='Title.jpg'>
                    <h4>
                        " rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
                    </h4>
                </td>
            </tr>
            <tr>
                <td colspan="2">

                    <div class="entry">
                    <?php the_content(); ?></div>

                </td>
            </tr>
            <tr>
                <td style="height: 44px" background='Comments.jpg'>
                    Posted By <?php the_author_posts_link(); ?>
                </td>
                <td style="height: 44px" background='Comments.jpg'>
                    in <p class="postmetadata"><?php _e( 'Posted in' ); ?> <?php the_category( ', ' );    ?></p>
                </td>
            </tr>
        </table>

    </td>
    <td style="width: 260px">
        SIDEBAR AND PROFILE TAGS HERE</td>
    </tr>
</table>

How I can fix this issue in the index.php?

brasofilo
  • 25,496
  • 15
  • 91
  • 179
Lisa Jaffe
  • 5
  • 1
  • 1
  • 3
  • 6
    1998 called.... – Steve Aug 22 '14 at 12:18
  • Hi, welcome to [so]. I've edited your post for clarity, please note that the code indentation can be done automatically in *any good code editor* and it makes wonders to understand the code logic. – brasofilo Aug 22 '14 at 12:29

1 Answers1

0

The problem is that you're printing your table inside The Loop. That sidebar <td style="width: 260px"> is being printed at every post. It is not a sidebar for all posts, it's just an individual sidebar to each post.

You'll need to read about Theme Development at the Codex to understand theme structures and best practices.

The reference to 1998 made in a comment is that tables are not used for layout purposes since long ago, see Why not use tables for layout in HTML?.
I'd suggest that you search for Starter Themes (like this) to build upon. For complete, exemplary, themes look for WordPress default ones, from Twenty Ten to Twenty Fourteen, to see how themes evolved in the last years.

Community
  • 1
  • 1
brasofilo
  • 25,496
  • 15
  • 91
  • 179