WordPress.org

Support

Support » How-To and Troubleshooting » get_term_by problem

get_term_by problem

  • My theme has a preview page, which display data from a custom post type entered in the screen before, however the author has left out a few fields, so im trying to get them plugged in.

    If i use
    ‘<?php echo wpautop(wptexturize($posted[‘job_term_salary’])); ?>’
    It displays the term ID of my selection on the previous page. I need it to display the actual name.

    Ive tried

    <?php $jobsal = get_term_by( 'slug', sanitize_title($posted['job_term_salary']), 'job_term_salary');
    echo $jobsal->name; ?>

    amongst other things, but i get nothing echoed. Any ideas what im doing wrong?

  • The topic ‘get_term_by problem’ is closed to new replies.
Skip to toolbar