Hi, I have problems to display the content with the 'options addon'
My PHP knowledge is only average, so I get stuck within the code unfortunately.
Hope somebody is able to have a look at my code.
Let me first explain what I did:
I made an Custom Field to use in the footer.
That CF is an Flexible content field
Inside this Flexible Field, I made 4 'Layouts", tow of those are repeaters (URL and name for links) and the other two are 'normal' content (A title, content and an image, no repeaters)
The content is generated within the option addon, beacuse I need that content throughout the whole site in the footer
So far so good!
My code is like this
Does anyone see what is wrong an d why the front does not show any content?
Really would appreciate any tips!
My PHP knowledge is only average, so I get stuck within the code unfortunately.
Hope somebody is able to have a look at my code.
Let me first explain what I did:
I made an Custom Field to use in the footer.
That CF is an Flexible content field
Inside this Flexible Field, I made 4 'Layouts", tow of those are repeaters (URL and name for links) and the other two are 'normal' content (A title, content and an image, no repeaters)
The content is generated within the option addon, beacuse I need that content throughout the whole site in the footer
So far so good!
My code is like this
while(has_sub_field("flexibele_content",'option')): // Custom Field name ?>
<?php if(get_row_layout() == "video"): // layout: video ?>
<?php the_sub_field("titel_video"); ?>
<?php elseif(get_row_layout() == "recent_project"): // layout: recent_project ?>
a rel="nofollow" href="?php the_sub_field(">" ><?php the_sub_field("titel_recent_project"); ?>
img src="?php the_sub_field(" alt="image" />" alt="<?php the_sub_field("titel_recent_project"); ?>" />
<?php the_sub_field("tekst_recent_project"); ?>
<?php elseif(get_row_layout() == "externe_links"): // layout: externe_links Repeater ?>
<?php if(get_field('externe_links')): ?>
<?php while(has_sub_field('externe_links')): ?>
sub_field_1 = <?php the_sub_field('naam_van_de_externe_link'); ?>,
sub_field_2 = <?php the_sub_field('url_van_externe_link'); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php elseif(get_row_layout() == "interne_link"): // layout: interne_links Repeater ?>
<?php if(get_field('interne_link')): ?>
<?php while(has_sub_field('interne_link')): ?>
sub_field_1 = <?php the_sub_field('naam_van_de_interne_link'); ?>,
sub_field_2 = <?php the_sub_field('url_van_de_interne_link'); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php endif; ?>
<?php endwhile; ?>
Does anyone see what is wrong an d why the front does not show any content?
Really would appreciate any tips!