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
I’ve now got this to work –
<?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
);
if ( $hb1 )
{
$link = get_field('media_outlet_url', $this->post->ID);
$media = get_field ('media_outlet', $this->post->ID);
$country = get_field ('country', $this->post->ID);
$publicationdate = get_field ('publication_date', $this->post->ID);
echo "<a href=$link target="_blank">$media</a>";
echo $publicationdate;
echo $country;
}
else if ( $hb2 && $hb3 )
{
the_field('media_outlet', $this->post->ID);
the_field('published_date', $this->post->ID);
the_field('country', $this->post->ID);
}
?>
Just trying to work out how to get the link to open in a blank page.
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.