Support Forum ยป User Profile

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • RoderickRoderick
    Participant

    Hello 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,
    Rod

    in reply to: โœ…Get parent term name and URL in MBViews #43074
    RoderickRoderick
    Participant

    Thank 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 %}
    in reply to: โœ…Enhance MB Views location conditions #43035
    RoderickRoderick
    Participant

    Hello Peter,

    This is great! Thank you so much for the help ๐Ÿ™‚ I will give this a try.

    Best regards,
    Roderick

    RoderickRoderick
    Participant

    @dmccan, thank you, yes you are right. This issue was fixed in the latest update.

    in reply to: โœ…How to display term field in post sidebar #41473
    RoderickRoderick
    Participant

    Thank 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.

    in reply to: โœ…How to display term field in post sidebar #41444
    RoderickRoderick
    Participant

    Thank 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,
    Rod

    in reply to: โœ…How to hide image if file is empty in MB Views #41426
    RoderickRoderick
    Participant

    For 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 %}
    
    in reply to: โœ…Filter post query based on term custom field #41400
    RoderickRoderick
    Participant

    Works like a charm! Thank you very much Peter.

    in reply to: โœ…How to hide image if file is empty in MB Views #40912
    RoderickRoderick
    Participant

    Apologies, 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>
    in reply to: โœ…Get only primary category #38630
    RoderickRoderick
    Participant

    Thanks 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 ๐Ÿ™‚

Viewing 10 posts - 1 through 10 (of 10 total)