the_category if/else statement
-
Hello π
Please can anyone help me with this?
I’m new in WordPress.
I need to make this: the sence if I have a class dportfolio – show
a category ‘dportfolio’. Otherwise show usual category.I use:
<?php if ( class_exists( 'DPortfolio' ) ) { echo DPortfolio::instance()->dportfolio_get_category(); }; ?>and when I try to add a second part of a code:
<?php the_category(', ') ?>
withif/elsestatement, I receive a php error.Please can someone help me to write this function in a correct way?
The topic ‘the_category if/else statement’ is closed to new replies.