i am using joomla 2.5 and i want to show some special text only in those articles which belongs to category id 11.
to get category id i tried:
<?php $catid = JRequest::getInt('catid'); echo $catid; ?>
to check if current category id is 11 and then show special text i used:
<?php $catid = JRequest::getInt('catid'); if ($catid == 11) {?>SPECIAL TEXT<?php } ?>
but it is not working :( text can be seen in all categories.
Your if
statement doesn't look right... try this:
<?php $catid = JRequest::getInt('catid'); if ($catid == 11) : ?>SPECIAL TEXT<?php endif; ?>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.