• Hi There,

    Thank you very much for making this plugin available and free for everyone. I use Advanced custom fields in all my WP themes unfortunately this data is not showing on the “amp” is there any way to display the ACF data on amp instead of the_content() or even better get both data (ACF the_content() ).

    Thank you

    Nuno

    https://www.ads-software.com/plugins/amp/

Viewing 3 replies - 1 through 3 (of 3 total)
  • You will have to use a filter to append an ACF field to the footer or content. See the docs for how to use a filter for the footer. We did this to append an ACF field to bottom of the content. Works ??

    Thread Starter nfsarmento

    (@nfsarmento)

    Hi neotrope, thank you for your reply, I have managed to call my template content parts by editing the single template on the plugin, adding this code snippet and deleting the sanitise content displayed from the plugin. I could have use a function to overwrite the single plugin template but for now I will have to use this until I found a better way to do it.
    I have noticed that the class-amp-content.php on line 37 is calling the_content I wonder if we can change it to acf_the_content ?

    <?php
        if( has_term( 'written', 'post_style' )) :
            get_template_part('templates/content', 'written');
    
        elseif( has_term( 'list', 'post_style' )) :
            get_template_part('templates/content', 'list');                 
    
        elseif( has_term( 'unordered-list', 'post_style' )) :
            get_template_part('templates/content', 'unordered-list');                 
    
        elseif( has_term( 'photo', 'post_style' )) :
            get_template_part('templates/content', 'photo');                 
    
        elseif( has_term( 'video', 'post_style' )) :
            get_template_part('templates/content', 'video');            
    
        else :
            get_template_part('templates/content', 'single');
    
        endif;
     ?>

    One thing you can do is create a custom template, as described here in the AMP plugin’s readme file: https://github.com/Automattic/amp-wp/blob/master/readme.md#custom-template

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Advanced Custom fields content are not showing it’ is closed to new replies.