WordPress.org

Ready to get started?Download WordPress

Forums

get_term_by problem (1 post)

  1. jeezyo
    Member
    Posted 2 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic