Hello all,
I have been trying to make the DCG display the post's excerpt if no description is available in the meta data.
The original code for where it display's text is in:
<h3><?php the_title(); ?></h3>
<?php if( get_post_meta($post->ID, "dfcg-desc", true) ): ?>
<p><?php echo get_post_meta($post->ID, "dfcg-desc", true); ?></p>
<?php elseif (empty($dfcg_category->category_description)): ?>
<p><?php echo $dfcg_imgdefdesc; ?></p>
<?php else: ?>
<p><?php echo $dfcg_category->category_description; ?></p>
<?php endif; ?>
My modified code is:
<h3><?php the_title(); ?></h3>
<?php if( get_post_meta($post->ID, "dfcg-desc", true) ): ?>
<p><?php echo get_post_meta($post->ID, "dfcg-desc", true); ?></p>
<?php elseif (empty($dfcg_category->category_description)): ?>
<p><?php echo $dfcg_imgdefdesc; ?></p>
<?php else: ?>
<p><?php echo $dfcg_category->category_description; ?></p>
<p><?php the_excerpt(); ?></p>
<?php endif; ?>
I have also tried cutting the elseif (empty($dfcg_category->category_description)): ?> statement from the deal, but I cannot make it show the excerpt.
The function the_excerpt() returns a set excerpt, or a 120 character block of the post while "in the loop". My demo is http://www.atwookie.com, and it is using the default images, but I want it to display the post's excerpt instead of a category description, as well, because the excerpt can be automatically generated.
If anybody has any thoughts, please help!!!
Thanks,
Chris