I love the page-link field type. The UI is perfect for CMS work. However, I have an issue. I’d like to be able to link to category / taxonomy archive pages – for instance http://example.com/my-category/.
Wordpress uses the template file taxonomy-slug.php, so each category can have an archive page.
What’s the best way to achieve this in ACF? I’d rather not just use a text field and rely on our users to correctly copy and paste the permalink.
Unfortunately, at the moment, a text field will be your best bet.
That or creating a new field type which includes the archive URLs you seek.
If you feel up to creating a new field type, there is plenty of docs and even a starter field template file to get you started over on the docs page!
Oh this is exactly what I’m looking for as well. I know there was nothing built-in available when this was first posted, but is this feature in the works at all for the near future?
+1 for this feature.
Me too, +1 for this feature.
+1 for me too.
any update on this? I was confused as the documentation shows that you can choose from Archives pages, but my Page Link does not ever show me archives… am I doing it wrong? (ACF Pro)
I’m very interested in this too. Has anyone figured out a good workaround?
Trying to do this within a repeater with page links, would rather not have to have multiple options in the repeater, page link for pages, and text field for categories.
+1 it would be very handy
+1 looking for this, should be a great addition to the page link field
+1 on this, but in the mean-time, I’ve created a workaround. Simply use a “Taxonomy” as a select or radio (single value) field, and to get a link to that taxonomy archive, use:
get_category_link( get_field( 'your-taxonomy-field' ) )
for example, I used it in this way:
printf( '<a href="%1$s">Your Category</a>', get_category_link( get_field( 'your-taxonomy-field' ) ) );
Is anyone still interested in this? I have put it together as a plugin for a personal site. It is currently only compatible with ACF Pro and not ready for public release, but I’d love to finish it if there’s any interest.
Sure! I was waiting for someone to ask about it before taking the time to properly package it. I’ll post a link here when it’s ready!
The topic ‘Page link to taxonomy / category page’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
Last but not least, we built a 100% PHP based Gutenberg Block API designed specifically for theme developers in the real world creating bespoke and maintainable blocks for future driven projects!https://t.co/bx8HrCwkjF— Advanced Custom Fields (@wp_acf) May 31, 2021
❤️ 10 of 10 pic.twitter.com/OacUqWGrZZ
© 2021 Advanced Custom Fields. Subscribe