I'm using advanced custom fields taxonomy field to select a particular term of a custom taxonomy. I can generate the term ID based on the field but I can't display the link or the name of the term. Below is the code that I have that is generating a blank page

   $term_id = get_sub_field('expertise_category');
   $term_link = get_term_link( $term_id , 'expertise' );
   echo $term_link
  • What have you done to debug? "Blank page" usually means fatal error. What PHP errors, if any, are being generated? What output do you get from $term_id and $term_link (e.g. via var_dump())? – Chip Bennett Nov 12 '13 at 16:39
  • the content shows up till that point and then the page is blank. there are no errors as such. $term_id and $term_link both give the output I was expecting, an integer and a url. When put together I receive the error. – Josh Nov 12 '13 at 17:13
  • You'll need to enable debugging. (i.e. set WP_DEBUG to true in wp-config.php) – Chip Bennett Nov 12 '13 at 17:18
  • Looks OK for me. Are there any errors/warnings when you turn WP_DEBUG on? – Krzysiek Dróżdż Nov 12 '13 at 17:21
  • No warnings with WP_debug. Where ever I place the code I get a blank page from that point on. – Josh Nov 12 '13 at 18:02

you need a semicolon at the end of your last line of code:

echo $term_link;

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.