Hi.
I'm having troubles to display a term custom field on front end of my project.
I've created a custom IMAGE field called "foto-del-autor" on a custom taxonomy called "autores".
Can you provide me with admin access to the page that you are testing this on ? As well as where the code is located so that I can have a short look as to how you are setting this up.
Based on your code the field should render the information.
I've enabled the private fields for your next response.
Hi Shane.
I'm working on localhost, sorry. And yes, it supposed to work I don't know what's the problem here.
I can show you some screens.
author-name and author-desc works well. But the two are text format.
<?php echo do_shortcode('[wpv-post-taxonomy type="autor" separator=", " format="text" show="name" order="asc"]'); ?>
<?php echo do_shortcode('[wpv-post-taxonomy type="autor" separator=", " format="text" show="description" order="asc"]'); ?>
Based on your screenshots it would appear that you're trying to pull this data on a Post output screen and not a taxonomy Archive. You can only display the taxonomy meta under 2 scenarios:
1. If you're on a taxonomy archive
2. If you specify the exact term id of the taxonomy term that you want to display.
From your screenshot none of these conditions are being met. In this case you will need to create a view to display the term meta given that we are unable to get the ID of the taxonomy term with any of our shortcodes.
What you will need to do is to use the'[wpv-post-taxonomy type="autor"] shortcode to return the slug and store that in a variable. Then pass the slug into the get_term_by function and which returns the term object.
Please let me know if this provides some clarity and points you in the right direction to get this resolved.
Hi Shane.
My taxonomy is OPINION and its terms are AUTORS.
And yes, this is a taxonomy file: single-opinion.php
You can see it on top of the last screenshot.
All I want to do is a Card of the autor of the text in the page, as you can see in the code . I can display the term description and the name of the autor, but NOT its photo.
No worries, you can provide me with a copy of the exact site. Its usually faster to debug with the entire site in hand rather than just the file because the file alone may not give the full context.
Hi Shane, thank you for your reply.
I really see a bit confusing having to duplicate a big entire website right now, I'm very busy with development and have a very tight deadline.
I've been using Toolset for several years now and I wouldn't want to use another plugin to do something that seemed simple. But I think it will have to be my alternative. Or some another custom function.
It is quite difficult to tell what is wrong without knowing the context of the site.
However you should be able to get the current taxonomy id with the following function.
$term_id = get_queried_object() -> term_id;
If this is a taxonomy archive then the get_queried_object() function should give you the taxonomy object that is currently being queried and allow you to pick the ID from it.
Please let me know if this was able to help you progress further.