• Resolved bababoom

    (@bababoom)


    I am using Advanced Custom Fields to display relative informations to my post but when I save the page the tags are not saved.

    Usually the tags are enter this way in wp editor:

    <p class="fattag">#TAG1 #TAG2 #TAG3</p>

    When I use the_field function this way in a php template it breaks my page completely:

    <p class="fattag"><?php the_field( 'my_tags' );?></p>

    I see that someone else have had this issue too, can you tell me please how to resolve it?

    • This topic was modified 6 years, 9 months ago by bababoom.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Peter Raschendorfer

    (@petersplugins)

    Tags are only saved when they appear in content. Adding a custom field just to insert the tags in it does not seem to make sense for me. That’s what the built in tags are for.

    But it should not brake your page. To display the links <?php do_hashtagger( the_field( 'my_tags' ) );?> should work.

    But automatically adding tags from an ACF field to a post is not possible.

    Does this solve your problem?

    Regards,
    Peter

    Thread Starter bababoom

    (@bababoom)

    Thanks for your answer Peter.

    I’ve put a category condition, if the category “A” is selected, it shows me the fields I need to fill, including tags fields. If not, then only the usual wordpress editor is shown.

    I wonder why there is a taxonomy field in ACF for post tags if they can’t save tags to a post?

    It’s weird as when I put tags in the fields from ACF, it saved them somehow as they’re still there when I refresh the page but they’re not linked to the post.

    Thread Starter bababoom

    (@bababoom)

    With few research I understand now why adding tags with ACF is impossible.

    So I let the content usual editor now to write and save tags in the posts.

    I also add a custom text field to format them the way I want (adding them a class) but when I add your code like that, it does not create the links:

    <p class="fattag"><?php do_hashtagger( the_field( 'my_tags' ) );?></p>

    Neither

    <?php do_hashtagger( the_field( 'my_tags' ) );?>

    create them, text remains unformat.

    Plugin Author Peter Raschendorfer

    (@petersplugins)

    Sorry, my fault.

    the_field() displays the value of your field, you have to use get_field() instead.

    So <?php do_hashtagger( get_field( 'my_tags' ) );?> should work.

    Regards,
    Peter

    Plugin Author Peter Raschendorfer

    (@petersplugins)

    Marked as resolved

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hashtag with Advanced Custom Field’ is closed to new replies.