derekfreeze
Member
Posted 5 months ago #
I'm working on a tweak for my company. I am trying to make an ifelse statement for this code.
title="<?php the_title(); ?>"><?php the_title(); ?>
The ifelse needs to make it so in place of the_title() is static text to display 'view this devotional' if a post is (in_category( 'Devotions' ) else display 'View this post'.
I am having trouble with it, if anyone could help me it would be greatly appreciated.
Replace the second:
<?php the_title(); ?>
with:
<?php
if (in_category('Devotions')):
echo "View this devotional";
else:
echo "View this post";
endif; ?>
Note: untested - please try on a test install first.
derekfreeze
Member
Posted 5 months ago #
Thank you so much. Just want i needed. I was doing the exact code, but i was forgetting the : after the ))
Thanks so much!!!
May God Bless You!