Support

Account

Home Forums General Issues Page link to taxonomy / category page

Solving

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.

    • Elliot

    • September 8, 2013 at 6:29 pm

    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

    • Lucas

    • May 22, 2014 at 7:20 am

    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

  • +1 for this feature.

  • Me too, +1 for this feature.

    • Darren

    • June 8, 2015 at 7:26 pm

    +1 for me too.

    • saturn

    • September 8, 2015 at 9:31 am

    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

  • +1

    I’m very interested in this too. Has anyone figured out a good workaround?

  • +1

    • omoyoto

    • January 28, 2017 at 4:07 am

    +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

    • mosne

    • February 17, 2017 at 9:51 pm

    +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' ) ) );

    • i1100a

    • November 29, 2017 at 7:29 am

    +1

    @dangercode Thanks, man. Your snippet pointed me in the right direction.

  • 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 +1 also interested in giving it a try. Thanks!

  • This reply has been marked as private.
  • @twgerard Have you made any progress on your plugin? Have the same issue, looking for a solution. Would be happy to test.

    Thanks,

    • bdebrie

    • October 7, 2018 at 1:46 am
    This reply has been marked as private.
  • +1

  • @twgerard — Any chance you’ve packaged that up yet?

Viewing 25 posts - 1 through 25 (of 32 total)

The topic ‘Page link to taxonomy / category page’ is closed to new replies.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.