• 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 } ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter 2bak860

    (@2bak860)

    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 } ?>

    Sounds interesting. Is your site up and running, so that we can have a preview?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘In Single show Custom fields in a category’ is closed to new replies.