Advertisement
nonameolsson

payandride

Mar 29th, 2013
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.20 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Loop
  4.  *
  5.  * This is a custom loop file, containing the looping logic for use in the "products" page tample.
  6.  *
  7.  * @package WooFramework
  8.  * @subpackage Template
  9.  */
  10.  global $more; $more = 0;
  11.  
  12. woo_loop_before();
  13.        
  14. if (have_posts()) { $count = 0;
  15. ?>
  16.  
  17. <div class="fix"></div>
  18. <?php
  19.     while (have_posts()) { the_post(); $count++;
  20.  
  21.         woo_get_template_part( 'content', get_post_type() );
  22.  
  23.     } // End WHILE Loop
  24. } else {
  25.     get_template_part( 'content', 'noposts' );
  26. } // End IF Statement
  27.  
  28. woo_loop_after();
  29.  
  30. woo_pagenav();
  31. ?>
  32.     <table id="allEvents" class="table">
  33.         <thead>
  34.             <tr>
  35.                 <th>Område</th>
  36.                 <th>Datum</th>
  37.                 <th>Typ</th>
  38.                 <th>Arrangör</th>             
  39.                 <th>Namn</th>
  40.                 <th>Länk</th>                  
  41.             </tr>
  42.         </thead>
  43.         <tfoot>
  44.             <tr>
  45.                 <th>Område</th>
  46.                 <th>Datum</th>
  47.                 <th>Typ</th>
  48.                 <th>Arrangör</th>             
  49.                 <th>Namn</th>
  50.                 <th>Länk</th>                  
  51.             </tr>
  52.         </tfoot>       
  53.         <tbody>
  54.             <?php
  55.             $args=array(
  56.                 'post_type'         => 'event', //Show the event post type
  57.                 'posts_per_page'    => '-1', //Shows all events, if not set this uses the value from Settings - Reading - Posts per page
  58.                 'orderby'           => 'date',
  59.                 'order'             => 'desc', 
  60.                 'meta_query' => array(
  61.                     array(
  62.                         'key' => 'name',
  63.                     )
  64.                 )
  65.             );
  66.             $my_query = null;
  67.             $my_query = new WP_Query($args);
  68.             if( $my_query->have_posts() ) {
  69.                 while ($my_query->have_posts()) : $my_query->the_post(); ?>
  70.                     <tr>
  71.                         <td><?php
  72.                             $mykey_values = get_post_custom_values('district');
  73.                             foreach ( $mykey_values as $key => $value ) {
  74.                                 echo "$value";
  75.                             } ?>
  76.                         </td>
  77.                         <td><?php
  78.                             $mykey_values = get_post_custom_values('date');
  79.                             foreach ( $mykey_values as $key => $value ) {
  80.                                 echo "$value";
  81.                             } ?>
  82.                         </td>
  83.                         <td><?php
  84.                             $mykey_values = get_post_custom_values('type');
  85.                             foreach ( $mykey_values as $key => $value ) {
  86.                                 echo "$value";
  87.                             } ?>
  88.                         </td>                      
  89.                         <td><?php
  90.                             $mykey_values = get_post_custom_values('organizer');
  91.                             foreach ( $mykey_values as $key => $value ) {
  92.                                 echo "$value";
  93.                             } ?>
  94.                         </td>
  95.                         <td><?php
  96.                             $mykey_values = get_post_custom_values('name');
  97.                             foreach ( $mykey_values as $key => $value ) {
  98.                                 echo "$value";
  99.                             } ?>
  100.                         </td>  
  101.                         <td>
  102.                             <a href="<?php
  103.                                 $mykey_values = get_post_custom_values('link');
  104.                                 foreach ( $mykey_values as $key => $value ) {
  105.                                     echo $value;
  106.                                 }?>
  107.                                 " target="_blank">
  108.                                 <?php
  109.                                     $mykey_values = get_post_custom_values('link_text');
  110.                                     foreach ( $mykey_values as $key => $value ) {
  111.                                         echo $value;
  112.                                 }?>
  113.                             </a>
  114.                         </td>                                          
  115.                     </tr>
  116.                 <?php
  117.                 endwhile;
  118.             } else {
  119.                 echo '<tr><td>Inga träningstävlingar tillagda för tillfället.</td></tr>';
  120.             }
  121.             wp_reset_query();  // Restore global post data stomped by the_post().
  122.             ?>
  123.         </tbody>
  124.     </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement