• Resolved pmooreimages

    (@pmooreimages)


    Hi,

    Thank you for this plugin.

    I am trying to display a Custom Taxonomy field as a list of terms but I am unable to get it to display anything other than “array” or the number of records in the array.

    I have also tried using the callback field and entering the infomation directly there but Im afraid Im very new to wordpress and cant seem to get it working.

    The code im using in my template to display the custom taxonomy is:
    <?php the_terms( $post->ID, 'tasks', 'Tasks: ', ', ', ' ' ); ?>

    Please help, ive spent all day trying to work this out lol

    https://www.ads-software.com/plugins/query-wrangler/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jonathan Daggerhart

    (@daggerhart)

    Hi pmooreimages,

    No problem. I can easily help with the custom callback field.

    1. Add a callback field and give it the value of ‘my_the_terms_field’.
    2. Check “Include additional information” and save the field.
    3. Save the query.
    4. In your functions.php file for your theme, add this code:

    function my_the_terms_field($this_post, $field, $tokens){
      ob_start();
      the_terms($this_post->ID, 'tasks', 'Tasks: ', ', ', ' ');
      return ob_get_clean();
    }

    That should handle what you need.

    Let me know if you run into trouble.

    Thanks,
    Jonathan

    Plugin Author Jonathan Daggerhart

    (@daggerhart)

    Edited my previous post. Forgot that the_terms echoes it’s results immediately. That might be fine, but to be sure I’ve added code that buffers the output.

    Thread Starter pmooreimages

    (@pmooreimages)

    Hi Jonathan,

    This does not show any content when “include additional information” is checked and a list of errors due to missing arguments when its not.

    (with your updated code above)

    Sorry not sure what im doing wrong, ive been through the steps above twice.

    Thread Starter pmooreimages

    (@pmooreimages)

    Sorry I have worked it out, It is working as you said but the issue is being coursed by another plugin not registering all of my new terms. Only works on the first post i did…which is now on page 3..

    Thread Starter pmooreimages

    (@pmooreimages)

    Thank you very much for all of your help and again, thank you for such a useful plugin!

    Plugin Author Jonathan Daggerhart

    (@daggerhart)

    No problem. Do you need further help making it work the way you need, or will you address it with the other plugin?

    Thread Starter pmooreimages

    (@pmooreimages)

    Your plugin is working as it should.

    I’ll just remove the other plugin and add the terms manually.

    Thank you again!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom Taxonomy’ is closed to new replies.