Advertisement
Guest User

Untitled

a guest
Jan 6th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.76 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The template for displaying all pages.
  4.  *
  5.  * This is the template that displays all pages by default.
  6.  * Please note that this is the WordPress construct of pages
  7.  * and that other 'pages' on your WordPress site will use a
  8.  * different template.
  9.  *
  10.  * @package testes
  11.  * @since testes 1.0
  12.  */
  13.  
  14. get_header(); ?>
  15.    
  16.         <div id="primary" class="content-area">
  17.             <div id="content" class="site-content" role="main">
  18.                 <h2>PRINT POST TYPE releases </h2>
  19.                
  20.                
  21.                 <?php
  22.                 echo "LANGUAGE: " . ICL_LANGUAGE_CODE . "<br>";
  23.                
  24.                 echo "<br><br><b>USING QUERY POSTS:</b><br><br>";
  25.  
  26.                 while ( have_posts() ) : the_post();
  27.                
  28.                     $args=array(
  29.                       'post_type' => 'releases',
  30.                       'posts_per_page' => -1
  31.                     );
  32.                     $my_query = new WP_Query($args);
  33.                     if( $my_query->have_posts() ) {
  34.                       while ($my_query->have_posts()) : $my_query->the_post();
  35.                             echo "NAME: " . get_the_title() . "<br>";
  36.                             echo "CONTENT: " . get_the_content() . "<br>";
  37.                       endwhile;
  38.                     }
  39.                    
  40.                    
  41.                     echo "<br><br><b>USING PODS2.0:</b><br><br>";
  42.                    
  43.                     $params = array('limit' => -1);
  44.                     $mypod = pods( 'releases', $params );
  45.                     $mypod->find($params);
  46.                     while ($mypod->fetch()) {
  47.                         $name = $mypod->display('name');
  48.                         $id =$mypod->display('ID');
  49.                         $relation =$mypod->display('rel_title');
  50.                         $content =$mypod->display('content');
  51.                         echo "ID: " . $id . "<br>";
  52.                         echo "NAME: " . $name . "<br>";
  53.                         echo "RELATION: " . $relation . "<br>";
  54.                         echo "CONTENT: " . $content . "<br>";
  55.                         echo "<br>#####<br>";
  56.                     }
  57.                    
  58.                    
  59.        
  60.                 endwhile;
  61.                
  62.                 ?>
  63.             </div><!-- #content .site-content -->
  64.         </div><!-- #primary .content-area -->
  65.  
  66. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement