Archived topic
Page.php
6 replies · Started by Marco Parma on December 27, 2014
Hi Tom
I am having problems with my pages. On the homepage the right sidebar is working fine, but on the other pages the sidebar is coming near the footer. I think i messed up the page.php. Can you have a look please:
http://lavoro-in-svizzera.com/cerco-lavoro-in-svizzera/
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package Generate
*/
get_header(); ?>
<div id="primary" <?php generate_content_class();?>>
<main id="main" <?php generate_main_class(); ?> itemprop="mainContentOfPage" role="main">
<?php do_action('generate_before_main_content'); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() ) : ?>
<div class="comments-area">
<?php comments_template(); ?>
</div>
<?php endif; ?>
<?php endwhile; // end of the loop. ?>
<?php do_action('generate_after_main_content'); ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
do_action('generate_sidebars');
get_footer();
Thanks
Marco
Tom, can you tell me if the page.php is right please?
I don't know why the sidebar is not working on the normal pages.
Hi Marco,
Any reason you edited page.php? Try replacing it with the original code: https://themes.svn.wordpress.org/generatepress/1.2.4/page.php
If that doesn't work, you probably have an unclosed HTML element within your content.
This means you may have opened a <div> without closing it (</div>).
That can cause the layout to go out of whack because it disrupts the flow of the HTML.
Let me know :)
I replaced the page.php but not working.
Also on a blank page i have the problem:
http://lavoro-in-svizzera.com/trovare-lavoro-in-svizzera/
but on error page is working
http://lavoro-in-svizzera.com/trovarie-lavoro-in-svizzera/
I will search for open html or do you have any other idea?
Try replacing the content-page.php file with the default file: https://themes.svn.wordpress.org/generatepress/1.2.4/content-page.php
It looks like you removed the end of a commented phrase after the closing </article>.
Dear Tom
Thanks a lot. Now is working
Have a nice day
Marco
Glad I could help :)