Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter sebastiansuciu

    (@sebastiansuciu)

    add_shortcode( 'list-attendee', 'ebig_post_listing_parameters_shortcode' );
    function ebig_post_listing_parameters_shortcode( $atts ) {
        ob_start();
     
        // define attributes and their defaults
        extract( shortcode_atts( array (
            'type' => 'mep_events_attendees',
            'order' => 'date',
            'orderby' => 'title',
            'posts' => -1,
            'tip' => '',
        ), $atts ) );
     
        // define query parameters based on attributes
        $options = array(
            'post_type' => $type,
            'posts_per_page' => -1,
            'paged' => $paged,        
        );
    
        // set the "paged" parameter (use 'page' if the query is on a static front page)
        $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
    
        if ($tip != "") {
            $options['meta_query'] = array(
                array(
                    'key' => 'ea_ticket_type',
                    'value' => $tip,
                ),
            );
        }
        
        $query = new WP_Query( $options );
        // run the loop based on the query
        if ( $query->have_posts() ) {
            ?>
            <div class="attendeelist">
                <table class="attendee-listing">
                    <tbody>
                        <tr>
                        <td style="text-align: center;"><span style="font-weight: 400;">Nume</span></td>
                        <td style="text-align: center;"><span style="font-weight: 400;">Prenume</span></td>
                        <td style="text-align: center;"><span style="font-weight: 400;">Oraș</span></td>
                        <td style="text-align: center;"><span style="font-weight: 400;">Club</span></td>
                        </tr>
                        <?php
                while( $query->have_posts() ) {
                    $query->the_post();
                    
                    $attendee_meta = get_post_custom(get_the_ID());
                    // print_r($attendee_meta);
                    ?>
                        <tr>
                        <td style="text-align: center;"><span style="font-weight: 400;"><?php echo $attendee_meta['ea_nume'][0]; ?></span></td>
                        <td style="text-align: center;"><span style="font-weight: 400;"><?php echo $attendee_meta['ea_prenume'][0]; ?></span></td>
                        <td style="text-align: center;"><span style="font-weight: 400;"><?php echo $attendee_meta['ea_oras'][0]; ?></span></td>
                        <td style="text-align: center;"><span style="font-weight: 400;"><?php echo $attendee_meta['ea_club'][0]; ?></span></td>
                        </tr>
                <?php 
                }
               
                // <nav class="pagination">
                // <?php pagination_bar( $query );
                // </nav> 
         
                ?>
                </tbody>
                    </table>
            </div> <?php
        } else {
            ?>
            <h6 style="color: #004693;">Momentan nu este niciun alergător la această cursă. Fii tu primul!</h6>
            <?php
        }
        
    
        wp_reset_postdata();
        $myvariable = ob_get_clean();
            return $myvariable;
    }
    
    Forum: Plugins
    In reply to: [Flamingo] Export problem
    Thread Starter sebastiansuciu

    (@sebastiansuciu)

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