2bak860
Member
Posted 7 years ago #
I'm designing a hotel directory website. I want to show custom field tags for posts in category 3 (as well as the_content). To my mind it should go:
<?php if (is_category(3)) {?>
- Address: <?php echo c2c_get_custom('Address'); ?>
- Bookings: <?php echo c2c_get_custom('Telephone'); ?>
- Price Category: <?php echo c2c_get_custom('Price Category'); ?>
- Nearest Beach: <?php echo c2c_get_custom('Nearest Beach'); ?>
<?php the_content('<p class="serif">Read the rest of this entry »'); ?>
<?php } ?>
<?php else (is_category()) {?>
<?php the_content('<p class="serif">Read the rest of this entry »'); ?>
<?php } ?>
2bak860
Member
Posted 7 years ago #
Well, I eventually found a way of doing it - thought I'd include it if anyone needed help on the same subject.
<?php if ( !(in_category('2')) ) { ?>
- Region: <?php the_category(' > ');Â ?>
- Address: <?php echo c2c_get_custom('Address'); ?>
- Bookings: <?php echo c2c_get_custom('Telephone'); ?>
- Type of Accommodation: <?php echo c2c_get_custom('Type of Accommodation'); ?>
- Price Category: <?php echo c2c_get_custom('Price Category'); ?>
- Nearest Beach: <?php echo c2c_get_custom('Nearest Beach'); ?>
<?php the_content('<p class="serif">Read the rest of this entry »'); ?>
<?php link_pages('Pages: ', '', 'number'); ?>
<?php } ?>
<?php if ( !(in_category('15')) ) { ?>
<?php the_content('<p class="serif">Read the rest of this entry »'); ?>
<?php link_pages('Pages: ', '', 'number'); ?>
<?php } ?>
subirghosh
Member
Posted 7 years ago #
Sounds interesting. Is your site up and running, so that we can have a preview?