Web Hosting Talk







View Full Version : wordpress theme layout issue...


photogray
05-02-2009, 09:26 PM
I'm using a wordpress theme on http://www.oxfordmsrestaurants.info

When clicking to view a single post the layout messes up and the sidebars appear under the post content.

Any ideas guys?

kpmedia
05-02-2009, 10:23 PM
It's probably a width issue in the CSS, for the single post page. Or an alignment issue.

To help any more, I have to actually see the PHP code through a WP account with admin permission, I'm terrible at trying to look at HTML output and reverse-engineer guess. Also more hands-on, prefer to "play with it" with tiny tests, see how it moves or changes per line of code adjusted. Goes a lot faster that way.

I deal with these a lot too.

Be sure to cross-browser test the site, be sure it looks good in IE6, IE7, IE8, Firefox 3, Safari and Chrome. Fun, huh?

photogray
05-02-2009, 11:47 PM
It's probably a width issue in the CSS, for the single post page. Or an alignment issue.

To help any more, I have to actually see the PHP code through a WP account with admin permission, I'm terrible at trying to look at HTML output and reverse-engineer guess. Also more hands-on, prefer to "play with it" with tiny tests, see how it moves or changes per line of code adjusted. Goes a lot faster that way.

I deal with these a lot too.

Be sure to cross-browser test the site, be sure it looks good in IE6, IE7, IE8, Firefox 3, Safari and Chrome. Fun, huh?

Ok do you want to do that?

s2mu3123
05-03-2009, 05:57 AM
It's basically an issue of the width in the CSS, or for the other pages also. Please check the layout for all pages and sidebar, left, right in its theme (an alignment issue)

foobic
05-03-2009, 06:52 AM
The single post layout is completely different. The home page has the sidebar in a div id sidebar, width 400px, while the single uses 2 divs class content, both 520px wide.

Use Firefox and the Firebug plugin - debugging this sort of issue becomes so much easier (right-click and inspect element).

Edit: in Wordpress, the files you need to compare are themes/yourtheme/index.php and themes/yourtheme/single.php

photogray
05-03-2009, 01:59 PM
Alright guys I'm a moron when it comes to this. $20 to someone who can fix it in wordpress theme editor for me. my icq is 239088209

photogray
05-03-2009, 07:17 PM
Ok here is single.php
<?php get_header(); ?>

<div id="post">

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="content">

<div class="date"><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></div>
<div class="entry">
<div class="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h2>

<?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>
<?php if ( function_exists('the_tags') ) { the_tags('<p>Tags: ', ', ', '</p>'); } ?>
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<div class="postmeta">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> </div>
</div></div>

<p class="postmetadata">
<small>
This entry was posted
<?php /* This is commented, because it requires a little adjusting sometimes.
You'll need to download this plugin, and follow the instructions:
http://binarybonsai.com/archives/2004/08/17/time-since-plugin/ */
/* $entry_datetime = abs(strtotime($post->post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */ ?>
on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>
and is filed under <?php the_category(', ') ?>.
You can follow any responses to this entry through the <?php comments_rss_link('RSS 2.0'); ?> feed.

<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
// Both Comments and Pings are open ?>
You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> from your own site.

<?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
// Only Pings are Open ?>
Responses are currently closed, but you can <a href="<?php trackback_url(true); ?> " rel="trackback">trackback</a> from your own site.

<?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
// Comments are open, Pings are not ?>
You can skip to the end and leave a response. Pinging is currently not allowed.

<?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
// Neither Comments, nor Pings are open ?>
Both comments and pings are currently closed.

<?php } edit_post_link('Edit this entry.','',''); ?>

</small>
</p>

</div>

<?php comments_template(); ?>

<?php endwhile; else: ?>

<p>Sorry, no posts matched your criteria.</p>

<?php endif; ?>

</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>





AND here is index.php



<?php get_header(); ?>



<div id="post">
<div padding="10px">
Google 468.80 banner here
</div>
<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>
<div class="content">
<div class="post" id="post-<?php the_ID(); ?>">

<div class="date"><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></div>

<div class="entry">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php the_content(''); ?>
<?php if ( function_exists('the_tags') ) { the_tags('<p>Tags: ', ', ', '</p>'); } ?>

<div class="postmeta">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> | <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read more..</a></div>
</div></div></div>

<?php endwhile; ?>

<div class="navigation">
<div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
</div>

<?php else : ?>

<h2>Not Found</h2>
<p>Sorry, but you are looking for something that isn't here.</p>
<?php endif; ?>


</div>

<?php get_sidebar(); ?>
<?php get_footer(); ?>

foobic
05-03-2009, 07:51 PM
Looks like your problem is in the comments template, which contains the dangerous statement "<!-- You can start editing here. -->" ;)

I don't think you're using it anyway (you still have the standard comment code), so change this line
<?php comments_template(); ?>
to this
<?php // comments_template(); ?>

photogray
05-03-2009, 08:03 PM
Looks like your problem is in the comments template, which contains the dangerous statement "<!-- You can start editing here. -->" ;)

I don't think you're using it anyway (you still have the standard comment code), so change this line
<?php comments_template(); ?>
to this
<?php // comments_template(); ?>



Thanks it worked, took me 24 hours to find any help even offering to pay lol.