- This topic has 12 replies, 3 voices, and was last updated 1 year, 3 months ago by Fernando.
-
AuthorPosts
-
December 2, 2022 at 9:37 am #2447016gpstart
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 urlBrand 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.
December 3, 2022 at 5:41 am #2447821DavidStaffCustomer SupportHi there,
for archives you would use the
generate_after_archive_title
See here for reference:
https://docs.generatepress.com/article/hooks-visual-guide/#archives
December 3, 2022 at 7:51 pm #2448572gpstartHi 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?
December 4, 2022 at 6:16 am #2448979DavidStaffCustomer SupportWhat happens if you add some static text to test ? Does it show the static text ?
December 4, 2022 at 8:19 am #2449189gpstartI 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.
December 4, 2022 at 8:51 am #2449215gpstartOk, 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 2You can see my Element:
https://drops.cyberfilebox.com/JruywQLDOutput:
https://drops.cyberfilebox.com/NQu4engpAny idea why it’s not outputing after the title and before the Description?
December 4, 2022 at 5:52 pm #2449585gpstartIt’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.December 4, 2022 at 6:40 pm #2449619gpstartI 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.
December 4, 2022 at 7:16 pm #2449634Fernando Customer SupportHello 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?
December 4, 2022 at 9:49 pm #2449723gpstartMy 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/NQu4engpAren’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?
December 4, 2022 at 11:15 pm #2449796Fernando Customer SupportI 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.
December 5, 2022 at 7:36 am #2450293gpstartThat did it!
Thank you once again!
December 5, 2022 at 5:00 pm #2450948Fernando Customer SupportYou’re welcome!
-
AuthorPosts
- You must be logged in to reply to this topic.