2
<?php
/*
Template Name: Index Page
*/
?>
<?php get_header(); ?>
<?php $about = new WP_Query( 'pagename=home' ); ?>
<?php if( $about->have_posts() ) : $about->the_post(); ?>
<?php the_content(); ?>
<?php endif; ?>
<?php $service = new WP_Query( 'pagename=service' ); ?>
<?php if( $service->have_posts() ) : $service->the_post(); ?>
<?php the_content(); ?>
<?php endif; ?>
<?php $portfolio = new WP_Query( 'pagename=portfolio' ); ?>
<?php if( $portfolio->have_posts() ) : $portfolio->the_post(); ?>
<?php the_content(); ?>
<?php endif; ?>
<?php get_footer(); ?>
The above code works but generates a space between a page and another how do I remove this?
Are you sure it’s in PHP?
– Renato Tavares
That code made a small part of me die... You don’t need to put <?php for each function, just put one and make as many statements as necessary. As for the question, we need you to show the HTML part to evaluate where the spacing is arising...
– Olimon F.