Hemingway Theme won’t go fullwidth
-
I ran into yet another “bug” in the Hemingway Theme concerning the page templates within the theme. Even though there are almost countless CLOSED topics on this issue, none of them solved my problem. I’m running version 2.2 of the theme and as a result of this issue, will likely “fork” this theme to keep future modifications from these authors from breaking the fixes that I get implemented.
So, and back to the bug that brought me here in the first place. Neither the “Full Width Template” nor the “No Sidebar Template” seem to change anything in my post or page display. I haven’t gone through all of the code to figure out why they aren’t working correctly on my site, I suspect it has something to do with the logic flow and not calling the is_page_template function at the appropriate time. I have examined the template files and they seem to be correct. Not being a WordPress developer, and having no desire to become one, I did however find a workaround.
You’ll need to modify your singular.php file to match this one:
<?php get_header(); ?> <main class="wrapper section-inner group" id="site-content"> <?php if ( is_page_template( 'template-fullwidth.php' ) ) { ?> <div class="site-content full-width"> <?php } else { ?> <div class="content left"> <?php } ?> <div class="posts"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); get_template_part( 'content', get_post_type() ); endwhile; endif; ?> </div><!-- .posts --> </div><!-- .content --> <?php if ( is_page_template( 'template-fullwidth.php' ) ) { //don't display sidebar } else { get_sidebar(); } ?> </main><!-- .wrapper --> <?php get_footer(); ?>
Basically this fix implements is_page_template calls to determine if the Full Width Template is being called and if it is, modifies the output accordingly. Essentially this is just changing the div element wrapper at the beginning of the content output to match that in the style.css file for this purpose, and removes the sidebar from the display output if the Full Width Template has been selected in your post or page attributes setting.
I hope this helps someone fix their theme. I truly love the simplicity and “bloggish” design of this theme, I just wish it actually worked out of the box as it should.
- The topic ‘Hemingway Theme won’t go fullwidth’ is closed to new replies.