I am on my way to make a theme for Wordpress, but I've got an issue that is close to make me pull hair out of my head :D
So I get this error:
Parse error: syntax error, unexpected 'endwhile' (T_ENDWHILE), expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) in /app/public/wp-content/themes/mazeit/index.php on line 398
I am trying to make a blog on the frontpage, where it will display the thumbnail, here is the code for it.
<div class="row">
<?php if(have_posts()) : ?>
<?php while(have_posts()) : the_post(); ?>
<div class="col-lg-4 col-md-6 col-sm-12 mb-lg-0 mb-4">
<article class="blog-post">
<?php if(has_post_thumbnail()) : ?>
<div class="post-thumbnail">
<?php the_post_tumbnail(); ?>
<ul class="meta-info list-inline">
<li class="posted-by">Skrevet af: <a href="<?php echo get_author_posts_url(get_the_author_meta('ID') ); ?>"><?php the_author(); ?></a></li>
<li class="post-date"><a href="#"><?php the_time('d/m/Y'); ?></a></li>
<li class="tags"> Kategori: <a href="#">
<?php
$categories = get_the_category();
$separator = ", ";
$output = '';
if ($categories) {
foreach ($categories as $category) {
$output .= '<a href="'.get_category_link($category->term_id).'">'.$category->cat_name.'</a>'. $separator;
}
}
echo trim($output, $separator);
?>
</a>
</li>
</ul>
</div>
<div class="post-content">
<div class="post-content-inner">
<h5 class="post-title"><a href="<?php the_permalink(); ?>"> <?php the_title(); ?></a></h5>
<p><?php the_excerpt(); ?></p>
</div>
<div class="read-more-wrapper">
<a href="<?php the_permalink(); ?>" class="read-more-link">Læs mere</a>
</div>
</div>
</article>
</div>
<?php endwhile; ?>
<?php else : ?>
<?php echo apautop('Her er der ikke meget..'); ?>
<?php endif; ?>
</div>
I hope that somebody can help me out here.