Site logo

Archived topic

Custom post layout problem

3 replies · Started by Hans on May 28, 2018

Viewing posts 1–4 of 4

Hi,

this image shows the problem I am trying to solve.

http://huppenbroich.de/spd-simmerath/wp-content/uploads/2018/05/problem-area.png

The content area should have the same distance from the window on all sides. This is true for all posts and pages except those of post type "mitglieder".

This is the code for single-mitglieder.php:

<?php
/**
 * The template for displaying all single posts.
 *
 * @package Generatepress
 */

get_header(); ?>

<!-- Hans Keutgen: Neue Datei für Theme - Mitglieder behandeln -->

	<div id="primary" <?php generate_content_class();?>>
		<main id="main" <?php generate_main_class(); ?>>
		<?php do_action('generate_before_main_content'); ?>
		<?php while ( have_posts() ) : the_post(); ?>

			<?php get_template_part( 'content', 'single' ); ?>
			
			<br>
						
<!--			<?php the_post_navigation(); ?> -->

			<?php
				// If comments are open or we have at least one comment, load up the comment template
				if ( comments_open() || get_comments_number() ) :
					comments_template();
				endif;
			?>

		<?php endwhile; // end of the loop. ?>

		</main><!-- #main -->
	</div><!-- #primary -->

<?php 
do_action('generate_sidebars');
get_footer();

The URL of post being wrong is in the "Your Website URL". What is wrong? The code or the CSS?

Hi there,

Try this CSS:

.separate-containers .site-main > * {
    margin-bottom: 0;
}

Then it looks like you have an extra <br> in the HTML that's causing the extra space:
http://www.screencast.com/t/1wIKzxGFFnd

Thanks, deleting the

br

solved the problem!

No problem!

This archived topic is closed to new replies.