How to display page content
-
Hello,
I’d like to display the Content of a WordPress Page. To show up the title I use single_post_title(); – but I cant find the call for the content which where defined for a related page.
<?php /* Template Name: Template "content" */?> <?php get_header(); ?> <?php $args = array( 'post_type' => "adventskalender", 'posts_per_page' => 1 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post() ?> <div class="background-box"> <?php echo get_the_post_thumbnail( $post_id, 'full', array() ); ?> </div> <h1> <?php the_title(); ?> <span><?php the_content(); ?></span> </h1> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'main-menu') ); ?> <?php endwhile; ?> <div id="content"> <p> <?php if ( have_posts() ) { single_post_title(); // // In here the "page description text" should show up // } ?> </p> </div> <?php get_footer(); ?>
Can someone help with the related snippet – thank yo in advance.
kind regards.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to display page content’ is closed to new replies.