Support

Account

Forum Replies Created

  • 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.

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