[Resolved] Add meta fields for custom taxonomy

Home Forums Support [Resolved] Add meta fields for custom taxonomy

Home Forums Support Add meta fields for custom taxonomy

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #2447016
    gpstart

    I created a custom post type of Brand with a custom taxonomy called Retailer.

    When a retailer archive is listed it looks like this:

    Retailer: Nordstrom

    Brand 1
    Brand 2
    etc.

    I want to insert 2 custom fields (which I already created using MetaBox). One is website url and the other is instagram url. So that it looks like this:

    Retailer: Nordstrom
    Website url
    Instagram url

    Brand 1
    Brand 2
    etc.

    I tried creating a block-hook, generate_after_entry_title, but, nothing shows up.

    Can someone please tell me the steps to get this working?

    Thanks.

    #2447821
    David
    Staff
    Customer Support

    Hi there,

    for archives you would use the generate_after_archive_title

    See here for reference:

    https://docs.generatepress.com/article/hooks-visual-guide/#archives

    #2448572
    gpstart

    Hi David,
    I changed it to the above, cleared the cache, but, the website and instagram urls don’t show up still.

    Anything you can suggest to debug why it’s not working?

    #2448979
    David
    Staff
    Customer Support

    What happens if you add some static text to test ? Does it show the static text ?

    #2449189
    gpstart

    I put in the words “static text test” and it showed up.

    So, I assume I’m not implementing the Headline block correctly.

    I’m just checking something I’ll update this in a moment.

    #2449215
    gpstart

    Ok, I got it working now.

    Just one thing though.

    I’m using after_archive_title hook, but, it actually displays after the Description, not right after the title.

    So, when the Retailer, Nordstrom displays, it shows up like this:

    Retailer: Nordstrom
    [Text from Description]
    Custom field 1
    Custom field 2

    You can see my Element:
    https://drops.cyberfilebox.com/JruywQLD

    Output:
    https://drops.cyberfilebox.com/NQu4engp

    Any idea why it’s not outputing after the title and before the Description?

    #2449585
    gpstart

    It’s working now.

    I wonder if I need to clear my Cloudflare cache too? I didn’t change anything and cleared my cache earlier, but, now it looks right.

    #2449619
    gpstart

    I thought it worked earlier, but, I just realized I was looking at a retailer with no description so it looked like it was outputting my custom fields right after the archive title. But, after I added a description, the fields were pushed down after the description.

    #2449634
    Fernando
    Customer Support

    Hello there,

    To clarify, are you referring to the custom field values you have not appearing when using a Headline Block?

    Have you checked if the custom field name is set correctly in the Dynamic settings of the Headline Block?

    If it isn’t working can you try creating a new custom basic text field and try to output that using a Headline Block to test?

    #2449723
    gpstart

    My custom fields are displaying with the correct link. But, they’re not displaying in the correct location.

    The fields are displaying after the Description as I showed in the 2nd link above.
    https://drops.cyberfilebox.com/NQu4engp

    Aren’t those custom fields (website and instagram) supposed to display before the description and right after the archive title if I use the generate_after_archive_title hook?

    #2449796
    Fernando
    Customer Support

    I see. Thank you for clarifying. Yes, it should be after the title but can you try giving it a lower value priority so that it goes before the description?

    Try giving the Element a priority of 1 for instance.

    Let us know how it goes.

    #2450293
    gpstart

    That did it!

    Thank you once again!

    #2450948
    Fernando
    Customer Support

    You’re welcome!

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.