I have the same problem here.
What is wrong?
NOT WORKING:
$currentpage = get_the_ID();
//$post_objects = get_field('related_posts', get_the_id());
$post_objects = get_field('related_posts', $currentpage);
WORKING:
$post_objects = get_field('related_posts', 1024);
@hube2 the code is great but I would like to add an else option for those unchecked.
a simple if else is not working
So if checked echo ‘checked’; else echo ‘unchecked’;
Please show me the light 😉
I got it to work with:
<?php if( have_rows('pagina_links_footer', 'option') ): ?>
<ul>
<?php while ( have_rows('pagina_links_footer', 'option') ) : the_row(); ?>
<li>
<?php $post_object = get_sub_field('pagina_link'); ?>
<?php if( $post_object ): ?>
<?php
$pagina_link_title = get_the_title($post_object->ID);
$pagina_link_url = get_field('link_url', $post_object->ID);
?>
<a href="<?php echo $pagina_link_url;?>"><?php echo $pagina_link_title;?></a>
<?php endif; ?>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
Hi,
My problem starts with the problem of saving different values for different languages in the Options page
Let me describe what I need with my option page.
– A text field
– A dropdown of pages present in the current language. These are visible when changing the WP-Admin language using the switch.
The workaround would be to give all the fields a different fieldname like “OPERATIECREATIE” said in his post. And adding a lot of code in the frontend
Please help.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.