I'm having a hard time figuring out how to set either the excerpt or the full content on my posts. I'm using post format, so far everything works, but when I click on a specific post, only the excerpt is displayed in the full post (because only the excerpt is set on format-video, for ex.).
I would like my post formats to display the excerpt when it's on loop.php (home page), and the full content when it's on single.php I am bad at php, but here is my code (which is obviously not working for a reason)
<?php if ( is_loop() ) { ?>
<?php custom_excerpt('custom_index'); ?>
<?php } elseif ( is_single() ) : { ?>
<?php the_content(); ?>
<?php } ?>
<?php endif; ?>
Could anyone tell me where is the mistake in my code ? Or is there a better solution to perform what I'm trying to do ?
is_loop()
should beis_home()
. Also, you are mixing syntax here, only use curlies to enclose your statements