
-
AuthorPosts
-
November 28, 2018 at 8:14 am #1038362
Hello,
with ACF i created a repeater field. Since i don´t want this field to be shown on every site in my backend i need a method to target specific sites or a group of sites.
So i choose to make a new template – called “news” – and told ACF only to be shown when the “news” template is choosen.
I put the code for my output into my function.php file. (not the best way but i don`t know it better).
All works fine, exept i don´t see the output from my repeater field in the frontend.
When i switch back to the “template-builder” template – all works.So i think i made a mistake while duplicating the template:
I copied the existing “template-builder”, renamed it to “template-news” and added /* Template Name: News */ on top of it – then i put the file into my child theme…Can you please help me, or point me in the right direction?
Best regards, chrisDecember 3, 2018 at 5:27 am #1040110Hey Chris,
Thank you for using Enfold.
If you’re not using the ALB then you should render the the ACF fields in the page.php file. If ALB is active, edit the template-builder.php file. Unfortunately, you can’t create a clone of the template-builder.php file or rename it.
Best regards,
IsmaelDecember 5, 2018 at 7:57 pm #1041357Hey Ismael,
Thank you for your tip. I duplicated the page.php file and renamed it – its working fine. Didn´t know that you can´t duplicate the template-builder.php file.You said i should render the ACF fields in the page.php file.
Can you give me a hint where i have to put my ACF Code in the page.php file so that it renders after the content? Right now i have my code in the function.php file:add_action('ava_after_content', 'add_content_after_content'); function add_content_after_content() { ?><div style="margin-top: 20px;"><?php if( have_rows('nslides') ): while( have_rows('nslides') ): the_row(); ?><div class='newsclass1 shadow'> <div class='newsclass2'> <img src='/fix/news/newslogo1.png' style="float:left"/> <img src='/fix/news/newslogo2.png' style="float:right"/> <div class='newsclass3'><?php the_sub_field('ntitel1'); ?></br><?php the_sub_field('ntitel2'); ?></div> </div> <div class='newsclass31'><img src='<?php the_sub_field('nbild'); ?>' class='newsclass4' /></div> <div class='newsclass31'><div class='newsclass5'><?php the_sub_field('ntext'); ?></div></div> </div> <?php endwhile; endif;?> </div><?php }
best regards
– chrisDecember 6, 2018 at 12:11 pm #1041598Hi,
page.php file so that it renders after the content?
Edit the includes > loop-page.php file and look for this code:
echo ' <div class="entry-content" '.avia_markup_helper(array('context' => 'entry_content','echo'=>false)).'>'; the_content(__('Read more','avia_framework').'<span class="more-link-arrow"></span>'); echo '</div> ';
Insert the render function below.
Best regards,
IsmaelDecember 10, 2018 at 7:37 pm #1043280Thank you, its working fine.
December 11, 2018 at 8:09 am #1043600Hi,
Great, glad you got it working. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardDecember 11, 2018 at 8:09 am #1043601Sorry, yes please close it.
December 11, 2018 at 10:05 am #1043667 -
AuthorPosts
- The topic ‘ACF repeater field not showing’ is closed to new replies.