Support

Account

Home Forums Front-end Issues Select field filter not working Reply To: Select field filter not working

  • Hi Elliot,

    Thanks for your response.

    I’ve tried it like this ;

    <?php echo get_sub_field('adres_lid', $row->post_id); ?>

    But it returns empty. Or isn’t it possible to show a subfield like that?

    This is the whole code now

    <?php
         
                            // get all rows from the postmeta table where the sub_field (type) equals 'type_3'
                            // - http://codex.wordpress.org/Class_Reference/wpdb#SELECT_Generic_Results
                                $rows = $wpdb->get_results($wpdb->prepare( 
                                    "
                                    SELECT * 
                                    FROM wp_postmeta
                                    WHERE meta_key LIKE %s
                                        AND meta_value = %s
                                    ",
                                    'leden_details_%_plaats_lid', // meta_name: $ParentName_$RowNumber_$ChildName
                                    'gytsjerk' // meta_value: 'type_3' for example
                                ));
                         
                            // loop through the results
                            if( $rows )
                            {
                                foreach( $rows as $row )
                                {
                                   
                         
                            ?>
    
                                <li class="leden-details"><?php echo get_the_title( $row->post_id ); ?></li>
                                <li class="leden-show"><?php echo get_sub_field('adres_lid', $row->post_id); ?></li>
    
                        <?php
                     
                            }
                        }
                     
                        ?>

    Thanks