Home › Forums › Front-end Issues › Merge an ACF URL and Text field to create a href › Reply To: Merge an ACF URL and Text field to create a href
Hi John
Thanks for getting back to me. I have tried to implement your suggestion but seem to be missing something – I am newish to php so my skills are improving daily but clearly not good enough to identify the problem.
I implemented this off the back of your suggestion –
<?php
$hb1 = in_category(
array('News','Features','Tech'),
$this->post->ID
);
$hb2 = in_category( array('Research'), $this->post->ID );
$hb3 = has_tag(
array( 'aged care', 'anxiety/stress', 'autism', 'cognitive', 'Dementia', "Parkinson's", 'sleep' , 'well-being' ),
$this->post->ID
);
$link = get_field('media_outlet_url', $this->post->ID);
if ( $hb1 )
{
?>
<a href="<php echo $link; ?>" target="_blank"><?php the_field('media_outlet',$this->post->ID); ?</a>
<?php
the_field('published_date', $this->post->ID);
the_field('country', $this->post->ID);
}
else if ( $hb2 && $hb3 )
{
the_field('media_outlet', $this->post->ID);
the_field('published_date', $this->post->ID);
the_field('country', $this->post->ID);
}
?>
But get an error.
Any help appreciated.
Thanks.
Best
G
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.