wordpress - How to make custom template include content from page editor without post loop? -
i want create custom page template have header , full-screen image. following codex article created custom page following
<?php /** * template name: custom template */ get_header(); ?> <?php // start loop. while ( have_posts() ) : the_post(); // include page content template. get_template_part( 'content', 'page' ); // end loop. endwhile; ?>
but when create new page using template , add <img src="link/to/image.jpg" alt="my image">
using page editor image nested in many div's , article tag (see below). want image tag followed header
can make fullscreen not boxed. there way directly add (without post loop) content typed in page editor page using custom templates?
i thought post loop adding stuff tried using get_template_part( 'content', 'page' );
without loop doesn't works.
this line get_template_part( 'content', 'page' );
fetch content content-page.php
. if dont want , display content replace line following line.
the_content();
Comments
Post a Comment