Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Loop
- *
- * This is a custom loop file, containing the looping logic for use in the "products" page tample.
- *
- * @package WooFramework
- * @subpackage Template
- */
- global $more; $more = 0;
- woo_loop_before();
- if (have_posts()) { $count = 0;
- ?>
- <div class="fix"></div>
- <?php
- while (have_posts()) { the_post(); $count++;
- woo_get_template_part( 'content', get_post_type() );
- } // End WHILE Loop
- } else {
- get_template_part( 'content', 'noposts' );
- } // End IF Statement
- woo_loop_after();
- woo_pagenav();
- ?>
- <table id="allEvents" class="table">
- <thead>
- <tr>
- <th>Område</th>
- <th>Datum</th>
- <th>Typ</th>
- <th>Arrangör</th>
- <th>Namn</th>
- <th>Länk</th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <th>Område</th>
- <th>Datum</th>
- <th>Typ</th>
- <th>Arrangör</th>
- <th>Namn</th>
- <th>Länk</th>
- </tr>
- </tfoot>
- <tbody>
- <?php
- $args=array(
- 'post_type' => 'event', //Show the event post type
- 'posts_per_page' => '-1', //Shows all events, if not set this uses the value from Settings - Reading - Posts per page
- 'orderby' => 'date',
- 'order' => 'desc',
- 'meta_query' => array(
- array(
- 'key' => 'name',
- )
- )
- );
- $my_query = null;
- $my_query = new WP_Query($args);
- if( $my_query->have_posts() ) {
- while ($my_query->have_posts()) : $my_query->the_post(); ?>
- <tr>
- <td><?php
- $mykey_values = get_post_custom_values('district');
- foreach ( $mykey_values as $key => $value ) {
- echo "$value";
- } ?>
- </td>
- <td><?php
- $mykey_values = get_post_custom_values('date');
- foreach ( $mykey_values as $key => $value ) {
- echo "$value";
- } ?>
- </td>
- <td><?php
- $mykey_values = get_post_custom_values('type');
- foreach ( $mykey_values as $key => $value ) {
- echo "$value";
- } ?>
- </td>
- <td><?php
- $mykey_values = get_post_custom_values('organizer');
- foreach ( $mykey_values as $key => $value ) {
- echo "$value";
- } ?>
- </td>
- <td><?php
- $mykey_values = get_post_custom_values('name');
- foreach ( $mykey_values as $key => $value ) {
- echo "$value";
- } ?>
- </td>
- <td>
- <a href="<?php
- $mykey_values = get_post_custom_values('link');
- foreach ( $mykey_values as $key => $value ) {
- echo $value;
- }?>
- " target="_blank">
- <?php
- $mykey_values = get_post_custom_values('link_text');
- foreach ( $mykey_values as $key => $value ) {
- echo $value;
- }?>
- </a>
- </td>
- </tr>
- <?php
- endwhile;
- } else {
- echo '<tr><td>Inga träningstävlingar tillagda för tillfället.</td></tr>';
- }
- wp_reset_query(); // Restore global post data stomped by the_post().
- ?>
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement