Support

Account

Home Forums General Issues foot notes within ACF

Solving

foot notes within ACF

  • Hi

    I am using some custom fields (type wysiwyg) and the plugin “Civil Footnotes” to use foot notes at the same time. This works in regular WordPress fields but not in ACF.
    Could you give me an advice how I can implement this?

    Thank you for any help!

    Regards Urs

  • Hi @urs63

    I am unfamiliar with the plugin “Civil Footnotes”.
    Perhaps you could explain how it doesn’t work with ACF and what you would expect it to do if the compatibility existed.

    Screenshots are always helpful!

    Thanks
    E

  • I think I know what is being asked, because I’m having a similar question.

    Some plugins that implement advanced typography functions (such as footnotes) seem to scan only within default WP the_content to run actions of what they do, missing WYSIWYG content from ACF Repeater or Flex Content fields.

    Probably going to be on the plugin side of code to get them to loop thru ACF content…?

  • Sorry to hijack this thread but I’m looking at the exact same issue. Civil footnotes is a basic plugin that allows content authors to write footnotes. The plugin hooks on to the_content and generates a list of numbered footnotes by searching for anything matching the (( this is a footnote )) pattern.

    Here’s the plugin: https://gist.github.com/Jolora/a947b856d3440f8cc029

    I was wondering if you could give a clue as to how I would go about getting this plugin to also search any WYSIWYG ACF fields, including those inside flexible content fields.

    Any help would be appreciated please. Thanks!

  • I’ve solved this myself by adding the following to my theme’s functions.php:

    function acf_apply_content_filter_for_api($value, $post_id, $field){
         return str_replace( ']]>', ']]>', apply_filters( 'the_content', $value) );
    }
    function add_content_filter_ACF(){
       if(!is_admin()){
          remove_all_filters('acf/format_value/type=wysiwyg');
          add_filter('acf/format_value/type=wysiwyg', 'acf_apply_content_filter_for_api', 10, 3);
       }
    }
    add_action('init', 'add_content_filter_ACF');
  • Hey @jolora

    This thread is a bit old but I thought I’d jump in. I’m using the Easy Footnotes plugin and was having the same problem you were having with Civil Footnotes. Your solution works (thank you!), but there’s a wrinkle…I’ve got multiple ACF WYSIWYG fields on my pages, and the footnotes are being output at the bottom of each one of them. So I’m seeing lots of repeating and redundant footnotes throughout the page content. What I need is to output the footnotes just once at the very bottom of the page, below all the content. Any ideas? Thanks in advance.

  • Hey @dadra

    I encountered a similar issue, and was researching forums to see if anyone found a solution and found this post. I’m using the Easy Footnotes plugin. I implemented @jolora solution, but the footnotes are also repeating in all the ACF WYSIWYG fields on the same post. Did you happen to find a solution to this issue? Thanks!

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘foot notes within ACF’ is closed to new replies.