Support

Account

Home Forums ACF PRO Can you check post type for post object field? Reply To: Can you check post type for post object field?

  • Nevermind, figured it!

    For anyone else with the same question we needed to use: get_post_type( get_the_ID() ) and set it as a variable.

    Eg:

    <?php 		
    $post_type = get_post_type( get_the_ID() );
    if ( $post_type == 'horses'):?>
    	<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
    <?php else:?>
    	<?php the_title(); ?>
    <?php endif;?>