Support » Fixing WordPress » Formatting for first post is different on other posts

  • When I apply changes to a single post it is correct for the most recent post but any after that have formatting issues.

    Look here and open the first and second posts to see my problem. Just curious where to go to change it so that the formatting is not different for the first post.

Viewing 14 replies - 1 through 14 (of 14 total)
  • esmi

    (@esmi)

    Forum Moderator

    Have you tried:

    – deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    – switching to the default theme to rule out any theme-specific problems.

    I’m working within a child theme of twenty twelve and after doing what you suggested it doesn’t seem to change anything. The main problem is that my social share widgets (which is a plugin) are fine on the first post but then different on the second post.

    It’s been a tricky process because the people I’ve been doing this blog for have a website with formatting and they wanted to match it exactly so I’ve had to sort of back my way into everything and it’s left me confused and I’m sure there have been some overlaps in styling and editing that have caused problems.

    esmi

    (@esmi)

    Forum Moderator

    What happens if you switch to the unedited parent theme?

    Michael

    (@alchymyth)

    Forum Moderator

    you have some broken code in the .entry-header section in content.php in the child theme;

    this is the corresponding section from the unedited Twenty Twelve:

    <header class="entry-header">
    			<?php the_post_thumbnail(); ?>
    			<?php if ( is_single() ) : ?>
    			<h1 class="entry-title"><?php the_title(); ?></h1>
    			<?php else : ?>
    			<h1 class="entry-title">
    				<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
    			</h1>
    			<?php endif; // is_single() ?>
    			<?php if ( comments_open() ) : ?>
    				<div class="comments-link">
    					<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
    				</div><!-- .comments-link -->
    			<?php endif; // comments_open() ?>
    		</header><!-- .entry-header -->

    also, possibly this error message in your site might further break the layout:

    error: Call to undefined function wp_pagenavi() in /nfs/c06/h04/mnt/92468/domains/circlesstudio.com/html/blog/wp-content/themes/childoftwentytwelve/front-page.php on line 35

    general, try to use the validator http://validator.w3.org/ to check inbetween customisation steps if the code is still ok;
    this is the error report from your site right now:
    http://validator.w3.org/check?uri=http%3A%2F%2Fcirclesstudio.com%2Fblog%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

    esmi: I’m a little hesitant to switch back to the unedited parent theme for fear of losing my content but I may try it eventually.

    alchymyth: Thank you for that suggestion. I’m not sure why I wasn’t aware of that code validator. What do you suggest as the best course of action from where I stand now? Should I go through the errors and try to correct them individually or is there a better way?

    Michael

    (@alchymyth)

    Forum Moderator

    Should I go through the errors and try to correct them individually or is there a better way?

    yes – there is no other way.

    http://codex.wordpress.org/Validating_a_Website

    esmi

    (@esmi)

    Forum Moderator

    I’m a little hesitant to switch back to the unedited parent theme for fear of losing my content

    Your content is stored in your database – not in your theme.

    Thank you both for your help. I will be working on this throughout the weekend and will hopefully have no more questions.

    alchymyth: as I go through each .php file in the backend I can’t find the errors shown in the code validator. Where do I go to find the files necessary to correct the errors? also, I’ve made the changes to the entry-header and am still having problems with formatting for the second post. Is there a way to make it so that there is no featured post so that all the formatting is consistent with all posts?

    Michael

    (@alchymyth)

    Forum Moderator

    Where do I go to find the files necessary to correct the errors?

    difficult question;

    you will need to have a good idea about how WordPress constructs a web page out of the various template files;
    http://codex.wordpress.org/Theme_Development#Anatomy_of_a_Theme

    the first many lines are usually from within header.php; then either index.php, archive.php, category.php etc; then maybe sidebar.php; then footer.php (?) (plus any amount of plugins and widget output in the sidebar section)

    the code validator can give you the context of the errors, so when you compare the html structure with the htmlof the templates, you might just be able to find the location where the error comes from.

    I can’t find the errors shown in the code validator.

    can you post a specific example?

    I think based on your answer I will be able to continue going through the templates and will eventually find the errors. It will just take some time. In regards to the first post having different formatting than the rest, do you think that it is more likely due to the errors in code or is there a function in wordpress that makes the formatting different for the first post?

    Michael

    (@alchymyth)

    Forum Moderator

    I think it is ‘due to the errors in code’

    for instance, there is now an error (unclosed div) in these lines (as seen in the html code in the browser):
    <div id="date-time"> Posted in <a href="http://circlesstudio.com/blog/category/content-marketing/" title="View all posts in Content Marketing" rel="category tag">Content Marketing</a>

    (might be from the (edited) function twentytwelve_entry_meta() (??)

    You’ll have to forgive me for sounding foolish. I’ve only been doing this for about a month and am working for a small web development shop as an apprentice so it’s kind of trial by fire. Just wanted to say thanks again for your continued support.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Formatting for first post is different on other posts’ is closed to new replies.