Beautiful! Yet, it doesn't work right now.
I took the orginal page code (I use the _S theme):
<?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 Jong Gooiland
* @since Jong Gooiland 1.0
*/
get_header(); ?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content .site-content -->
</div><!-- #primary .content-area -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
And made a page template based on the code above:
<?php
/*
Template Name: Voorpagina
*/
get_header(); ?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php $args = array( 'posts_per_page' => 3 );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<div <?php post_class();?> id="post-<?php the_ID();?>">
<ul>
<?php
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<li><?php $excerpt = get_the_excerpt( $deprecated ) ?></li>
</ul>
</div>
<?php endforeach; ?>
</div><!-- #content .site-content -->
</div><!-- #primary .content-area -->
<?php get_footer(); ?>
The page where the template is activated won't work. Do you see the problem?
I appreciate your help very much!