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.
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.
What happens if you switch to the unedited parent theme?
you have some broken code in the
.entry-headersection 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:
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?
Should I go through the errors and try to correct them individually or is there a better way?
yes – there is no other way.
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?
Where do I go to find the files necessary to correct the errors?
you will need to have a good idea about how WordPress constructs a web page out of the various template files;
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?
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
- The topic ‘Formatting for first post is different on other posts’ is closed to new replies.