Support

Account

Home Forums Front-end Issues Custom Fields aren\'t showing up for custom post types

Solved

Custom Fields aren\'t showing up for custom post types

  • Hi,

    I’m trying to get these custom fields to display on a custom post type but none of the fields are showing up on the front end – not even text.

    I want to display the option selected for the Title (see image below) but can’t seem to work out what’s wrong?

    Here’s the code:

    <?php if(get_field('cpt_homepage_closure_announcement', 3554) ): ?>
    		<h2> <?php the_field('title')?> </h2>
    		<h3> <?php the_field('subheading')?> </h3>
    	<?php else : ?>
    		NOT ticked
    	<?php endif; ?>

    cpt_homepage_closure_announcement is a true/false field
    3554 is the page id
    title is the radio button field

    I hope this makes sense and any help would be appreciated.

  • Are title and subheading fields also on post 3554?

  • Sorry, forgot to update this ticket! This has been solved!

    Yes they were both on post 3554 – there was an issue with the child theme.

    We tested the code on two sites (with and without the child theme) and it worked fine on the one without.

    Thank you for your reply though.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Custom Fields aren\'t showing up for custom post types’ is closed to new replies.