0

I have a small listing-type block on a website that displays editorial titles which when clicked I want a new browser to open and the resulting page display the external page related to the clicked title in a new browser window.

I created a ACF field called title_link and this was working. However, I have just stripped back the Custom Fields to make the UX more intuitive. It broke, I have played with the code, I know it’s simple but I have gone blank as to why.

<a href=<<? php get_field( 'title_link', $this->post->ID );?> target="_blank"><?php echo get_the_title( $this->post->ID );?></a>

All and any help received gratefully.

G

  • Is that <<? php just a typo in the question? And the href value needs to be in quotes - href="value". – Sally CJ Jul 25 at 22:49
0

Have solved it.

       <div><a target="_blank" href="<?php the_field('title_link', $this->post->ID); ?>" rel="bookmark" title="<?php echo get_the_title( $this->post->ID );//$title; ?>"><?php echo get_the_title( $this->post->ID ); //$title; ?></a>   </div>            

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.