Support

Account

Forum Replies Created

  • Hi, if I wanted to integrate your code with the groups code? How can I do that?

    <?php $annata2 = get_field('anno_2'); if( $annata2 ): ?> <?php echo $annata2['testo_icona_1_anno_2']; ?> <?php endif; ?>

    Thanks

  • <?php
                    
                    $args = array(
                        'post_type' => array('wine_code', 'page'),
                        'order' => 'ASC',
                        'posts_per_page' => -1,
                    );
    
                    // Eseguo la query
                    $the_query = new WP_Query($args);
    
                    // Conto gli elementi
                    $count = $the_query->post_count;
    
                    $output= (isset($_POST['submit']))?$_POST['input']:'';
    
                    ?>
        
                    <?php
                        $categories = get_categories(); $count = count($categories);
                            foreach ($categories as $category) {}
                    ?>
        
                    <p data-aos="fade" style="color:#fff;">Inserisci il codice riportato sulla bottiglia<p>
                    
                    <form method="post" style="width: 50%;margin: auto;">
                        <input type="text" class="form-control" name="input"/> <!-- thiss is where the user enters text -->
                        <input type="submit" class="btn btn-primary" name="submit" value="submit"> 
                    </form>
            </section>
            <!-- Type service-->
            <section class="webpage__type-service type-service">
            <?php
                    $first_query = new WP_Query( $args );
                        while ($first_query->have_posts()) : $first_query->the_post();
                        //the_title();       //echo the title
                        //the_content();    //echo the content
                        
                        $post_id = get_the_ID(); // or use the post id if you already have it
                        $category_object = get_the_category($post_id);
                        $category_name = $category_object[0]->name;
                                
                            $str = get_the_content(); 
                            $choices = explode("-",$str);
                            //var_dump($ctg);
                            
                            //echo '<p>' . $category_name . '</p>';
                                
                            //foreach($choices as $key => $value){
                                //echo '<p>' . $value  . '</p>';}
    
                            
                            if (in_array($output, $choices)) {
                                
                                if ($category_name == "2014") {
                                echo "<div class='container'>
                                <h2 class='type-service__heading heading' data-aos='fade'>Anno 2014</h2>
                                <div class='type-service__text' data-aos='fade'>We provide best solutions for your dream, still adapt your budget & still match twith requires about quality of project</div>
                                <ul class='type-service__list row'>
                                    <li class='type-service__item col-12 col-md' data-aos='fade'>
                                        <div class='type-service__item-icon type-service__item-icon--interior'>
                                        </div>
                                        <h3 class='type-service__item-heading'>kpiopiopi</h3>
                                        <div class='type-service__item-text'>ghjghjghjgh</div>
                                    </li>
                                    <li class='type-service__item col-12 col-md' data-aos='fade'>
                                        <div class='type-service__item-icon type-service__item-icon--interior'>
                                        </div>
                                        <h3 class='type-service__item-heading'>3wertgfthfg</h3>
                                        <div class='type-service__item-text'>llhjgfdghj</div>
                                    </li>
                                    <li class='type-service__item col-12 col-md' data-aos='fade'>
                                        <div class='type-service__item-icon type-service__item-icon--interior'>
                                        </div>
                                        <h3 class='type-service__item-heading'>khgfdfhjkl</h3>
                                        <div class='type-service__item-text'>jhgfd</div>
                                    </li>
                                </ul>
                                </div>";          
                            } elseif ($category_name == "2015") {
                                echo "Questa bottiglia รจ stata prodotta nel 2015";
                                }
                                    }
                        endwhile;
    
                        wp_reset_query();
                    ?>

    I would like to put in place of the random words the fields I created in the acf group. how is this possible?

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