I have a turnery operator that checks if a Wordpress post type is of link format. If it is it outputs a custom field and if it isn't it outputs the permalink.
How would I go about also checking if the custom field is empty? So that if it is empty the permalink is output and if it isn't the custom field is output.
This is what I have so far.
<h3><a href="<?php get_post_format() == 'link' ? the_field("external_link") : the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
I am thinking something along the lines of this but it doesn't seem to work.
<h3><a href="<?php get_post_format() == 'link' && the_field("external_link") !="" ? the_field("external_link") : the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
()around condition and check:-(get_post_format() == 'link' && the_field("external_link") !="")