Forum Replies Created
-
AuthorPosts
-
June 6, 2025 at 1:14 AM in reply to: โ Bug report: Quick edit for posts with a custom taxonomy not working/updating #48385
Roderick
ParticipantHello Peter,
Thanks for checking. That is strange. I also tried on a clean install and it works.
So, I went ahead and deleted the Taxonomy on my live site and added a new one instead. This solved the issue. I guess a strange bug.Anyway, it's solved.
Thanks again,
RodRoderick
ParticipantThank you once again Peter, it works perfectly!
For future reference, here is my finished MB views code:
{% set current_term = mb.get_term_by( 'id', term.id, 'category' ) %} {# Check to see if the current term has a parent #} {% if current_term.parent %} {% set parent_term = mb.get_term_by( 'id', current_term.parent, 'category' ) %} <div> <a href="{{ mb.get_term_link( parent_term, 'category' ) }}"> All posts of <span>{{ parent_term.name }}</span> </a> </div> {% endif %}Roderick
ParticipantHello Peter,
This is great! Thank you so much for the help ๐ I will give this a try.
Best regards,
RoderickMay 20, 2023 at 10:57 PM in reply to: โ MB Views shortcode not rendering in block theme template #41865Roderick
Participant@dmccan, thank you, yes you are right. This issue was fixed in the latest update.
Roderick
ParticipantThank you once again Peter! I got it working thanks to you.
I wish Metabox tutorials would contain a bit more of these types of 'micro lessons' and how to's.
Roderick
ParticipantThank you very much Peter. I was wondering, is it also possible to use a shortcode to set the term ID? This shortcode is placed in my functions.php file and outputs the ID of the primary category of my post: [yoast-primary-category-id]. I want to use this to set the term ID dynamically.
I tried to use a function 'do_shortcode' for the shortcode, but this does not seem to work.
Hope you have an idea for this too?{% set category_id = mb.function('do_shortcode', '[yoast-primary-category-id]') %} {% set term_bookinglink = mb.rwmb_meta( 'bookinglink', { object_type: 'term' }, category_id ) %} {{ term_bookinglink }}Thanks a million,
RodRoderick
ParticipantFor future reference in case someone needs to find a solution. I managed to get this working by moving the 'if' condition after the 'set field' line and using 'field.full.url'.
{% set field = attribute( term, 'featured-image' ) %} {% if field.full.url is not empty %} <img src="{{ field.full.url }}" width="{{ field.full.width }}" height="{{ field.full.height }}" /> {% endif %}Roderick
ParticipantWorks like a charm! Thank you very much Peter.
Roderick
ParticipantApologies, here is the code again.
<div> {% if attribute( term, 'featured-image' ) is not empty %} {% set field = attribute( term, 'featured-image' ) %} <img src="{{ field.full.url }}" width="{{ field.full.width }}" height="{{ field.full.height }}" /> {% endif %} </div>Roderick
ParticipantThanks for the advise! I didn't manage to exactly how you explained, as It's too difficult for me. But I got it to work via the extra code and shortcode ๐
-
AuthorPosts