Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Endif

$
0
0

Replies: 0

Hi,

I just created my first WordPress theme and it works fine on my Wamp-server.
But after uploading it to my site, I get an endif syntax error which is not occurring on my localhost.

The code for displaying a certain category posts:

<?php if ( has_post_thumbnail() ) {
	
	// Get the post thumbnail URL
	$feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
} else {
	
	// Get the default featured image in theme options
	$feat_image = get_field('default_featured_image', 'option');
} ?>

<div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 col-xs-12 square" style="background-image: url(<?php echo $feat_image; ?>);" onClick="location.href=' <?php the_permalink(); ?> ';" id="linkeddiv">
    <div class="marginsquareproject">
        <div class="show"><img src="http://localhost/wordpress/wp-content/themes/abcd/images/show.png" class="img-fluid showicon" alt="Placeholder image"></div> 
    </div>
</div>

<? endif; ?>

Error:
—–
Jouw PHP-wijzigingen zijn teruggedraaid vanwege een fout op regel 21 in het bestand wp-content/themes/abcd/content-project-front.php. Repareer en probeer opnieuw.

syntax error, unexpected ‘endif’ (T_ENDIF), expecting end of file
—–

But I need the endif… what goes wrong here?


Viewing all articles
Browse latest Browse all 59525

Trending Articles