Support

Account

Home Forums General Issues Fieldtype Checkbox only gets one *unselected* value Reply To: Fieldtype Checkbox only gets one *unselected* value

  • I only have that one loop, and then other fields like text and link

    I don’t know if you can see much out of it – there are php between the Danish mumbojumbo language but here is the whole page code:

    
    <?php
    
        /**
         * Template Name: Forside
         */
    
        get_header();
    
    ?>
    <main class="main" role="main">
        <div class="container">
    
            <?php while ( have_posts() ) : the_post(); ?>
    
                        <div class="content">
                            <?php the_content(); ?>
    
                            <?php 
                            $hero_cta = get_field('forside_hero_cta'); 
                            if ($hero_cta) :
                            ?>
                            <div class="focus_cta">
                                <a href="<?php echo $hero_cta['url']; ?>" title="<?php echo $hero_cta['title']; ?>" class="cta"><?php echo $hero_cta['title']; ?> <i class="fa-solid fa-briefcase-medical"></i></a>
                            </div>
                            <?php endif; ?>
    
                            <?php
                            $services = get_field('forside_ydelser');
                            if( $services ): ?>
                                <div class="services-section">    
                                    <h2><?php echo $services['ydelse_overskrift']; ?></h2> 
                                    <div class="services">
                                        <a href="<?php echo $services['cta_link_1']['url']; ?>" title="<?php echo $services['cta_link_1']['title']; ?>" class="service"> 
                                            <h3><?php echo $services['ydelse_1_overskrift']; ?> <i class="fa-solid fa-circle-nodes"></i></h3>
                                            <?php echo $services['ydelse_1_tekst']; ?>
                                            <span class="readmore"><?php echo $services['cta_link_1']['title']; ?> <i class="fa-solid fa-arrow-right-long"></i></span>
                                        </a>
    
                                        <a href="<?php echo $services['cta_link_2']['url']; ?>" title="<?php echo $services['cta_link_2']['title']; ?>" class="service">
                                            <h3><?php echo $services['ydelse_2_overskrift']; ?> <i class="fa-solid fa-gears"></i></h3>
                                            <?php echo $services['ydelse_2_tekst']; ?>
                                            <span class="readmore"><?php echo $services['cta_link_2']['title']; ?> <i class="fa-solid fa-arrow-right-long"></i></span>
                                        </a>
                                    
                                        <a href="<?php echo $services['cta_link_3']['url']; ?>" title="<?php echo $services['cta_link_3']['title']; ?>" class="service">
                                            <h3><?php echo $services['ydelse_3_overskrift']; ?> <i class="fa-solid fa-hashtag"></i></h3>
                                            <?php echo $services['ydelse_3_tekst']; ?>
                                            <span class="readmore"><?php echo $services['cta_link_3']['title']; ?> <i class="fa-solid fa-arrow-right-long"></i></span>
                                        </a>
    
                                        <a href="<?php echo $services['cta_link_4']['url']; ?>" title="<?php echo $services['cta_link_4']['title']; ?>" class="service">
                                            <h3><?php echo $services['ydelse_4_overskrift']; ?> <i class="fa-solid fa-arrow-trend-up"></i></h3>
                                            <?php echo $services['ydelse_4_tekst']; ?>
                                            <span class="readmore"><?php echo $services['cta_link_4']['title']; ?> <i class="fa-solid fa-arrow-right-long"></i></span>
                                        </a>
                                    </div>
                                    <div class="focus_cta">
                                        <a href="#" title="Få tilsendt et overblik over alle ydelserne" class="cta">Få tilsendt et overblik over alle ydelserne <i class="fa-solid fa-arrow-right-long"></i></a>
                                    </div>
                                </div>
                            <?php endif; ?>
    
                            <?php
                            $cases = get_field('forside_cases');
                            
                            if( $cases ): ?>
    
                                <div class="cases-section">
                                    <h2><?php echo $cases['cases_overskrift']; ?></h2> 
                                    <div class="container">
                                        <div class="case-text col col--xs-12 col--sm-12 col--md-6 col--lg-6">
                                            <p class="title"><?php echo $cases['case_virksomhedsnavn']; ?></p>
                                            <p class="text"><?php echo $cases['case_tekst']; ?></p>
                                            
                                            <?php 
                                            $active_services = get_field("aktive_ydelser");
    
                                            //var_dump($active_services);
    
                                            if( $active_services ): 
                                            ?>
                                            <p>Samarbejdet indeholder bla.</p>
                                            <ul>
                                                <?php foreach ( $active_services as $active_service): ?>
                                                <li class="active-service"><?php echo $active_service; ?></li>
                                                <?php endforeach; ?>
                                            </ul>
                                            <?php endif; ?>
    
                                            <a href="#" title="Se cases" class="cta">Send mig et forslag på et samarbejde <i class="fa-solid fa-arrow-right-long"></i></a>
    
                                        </div>
                                        <div class="case-image col col--xs-12 col--sm-12 col--md-6 col--lg-6">
                                            <img src="<?php echo $cases['case_billede_url']; ?>" alt="<?php echo $cases['case_virksomhedsnavn']; ?>">
                                        </div>
                                    </div>
                                </div>
    
                            <?php endif; ?>
                            
                        </div>
    
            <?php endwhile; ?>
    
        </div>
    </main>
    
    <?php get_footer(); ?>