paste.xcode.ro » ~/paste/1034

  1. /* in front-page.php lines: 81 - 94 you have script */
  2. <?php
  3.         if( have_posts() ){
  4.                 while( have_posts() ){
  5.                         the_post();
  6.                         get_template_part( 'cfg/templates/view/list-view' );
  7.                 }
  8.         }
  9.         else{
  10.                 echo '<h3>' . __( 'Not found results' , 'myThemes' ) . '</h3>';
  11.                 echo '<p>' . __( 'We apologize but this page, post or resource does not exist or can not be found. Perhaps it is necessary to change the call method to this page, post or resource.' , 'myThemes' ) . '</p>';
  12.         }
  13.  
  14.         get_template_part( 'cfg/templates/pagination' );
  15. ?>
  16.  
  17. /* replace this script with */
  18. <?php
  19.         $query = new WP_Query(
  20.                 array(
  21.                         'cat' => array( 1, 2, 3 ) /* CATEGORIES ID's FROM WHAT TO DISPLAY ARTICLES */
  22.                 )
  23.         ); /* MORE ABOUT WP_QUERY - http://codex.wordpress.org/Class_Reference/WP_Query */
  24.  
  25.         if( $query -> have_posts() ){
  26.                 while( $query -> have_posts() ){
  27.                         $query -> the_post();
  28.                         get_template_part( 'cfg/templates/view/list-view' );
  29.                 }
  30.         }
  31.         else{
  32.                 echo '<h3>' . __( 'Not found results' , 'myThemes' ) . '</h3>';
  33.                 echo '<p>' . __( 'We apologize but this page, post or resource does not exist or can not be found. Perhaps it is necessary to change the call method to this page, post or resource.' , 'myThemes' ) . '</p>';
  34.         }
  35.  
  36.         get_template_part( 'cfg/templates/pagination' );
  37. ?>
Language: php
Posted by mythem.es at 28 Aug 2013, 02:21:07 Europe/Bucharest