0

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

 <?php 
   $term_id = get_sub_field('expertise_category');
   $term_link = get_term_link( $term_id , 'expertise' );
   echo $term_link
 ?> 
7
  • 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())? Commented Nov 12, 2013 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
    Commented Nov 12, 2013 at 17:13
  • You'll need to enable debugging. (i.e. set WP_DEBUG to true in wp-config.php) Commented Nov 12, 2013 at 17:18
  • Looks OK for me. Are there any errors/warnings when you turn WP_DEBUG on? Commented Nov 12, 2013 at 17:21
  • No warnings with WP_debug. Where ever I place the code I get a blank page from that point on.
    – Josh
    Commented Nov 12, 2013 at 18:02

1 Answer 1

-1

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 and acknowledge you have read our privacy policy.

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