Home › Forums › General Issues › Page link to taxonomy / category page
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.
Hi @timshutes
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!
Good luck
Thanks
E
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?
Thanks!
Lucas
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)
http://www.advancedcustomfields.com/resources/page-link/
+1
I’m very interested in this too. Has anyone figured out a good workaround?
+1
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 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.
@twgerard I am definitely interested in this. Can I test out your plugin?
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!
@twgerard Have you made any progress on your plugin? Have the same issue, looking for a solution. Would be happy to test.
Thanks,
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.