Advertisement
Guest User

Pages problem

a guest
Feb 15th, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.25 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <body>
  3.     <nav><?php wp_nav_menu( array( 'theme_location' => 'top-menu', 'menu_class' => 'top_menu', 'menu_id' => 'top_menu' ) ); ?>
  4.       <div id="left">
  5.         <form action="" method="get" role="search">
  6.             <input type="search" type="text" name="s" id="s" placeholder="חיפוש"/><i id="settings" class="fa fa-cog"></i>
  7.         </form>
  8.       </div>
  9.     </nav>
  10.     <div id="settings-m"><a href="#">מחובר בתור<span> yotamN</span></a><a href="#">הצג פרופיל</a><a href="#">העלה סיקור</a><a href="#">התנתק</a></div>
  11.     <div id="main">
  12.       <header>
  13.         <?php $count = 0; ?>
  14.  
  15.         <?php
  16.         $homeArgs = array(
  17.             'posts_per_page' => 4
  18.         );
  19.         $homeQuery = new WP_Query( $homeArgs );
  20.         while ( $homeQuery->have_posts() ) : $homeQuery->the_post();
  21.         ?>
  22.             <?php
  23.             if ($count < 3){
  24.              
  25.                 // LOOP STRUCTURE FOR OUR LATEST POST
  26.             ?>
  27.             <a href="<?php the_permalink(); ?>">
  28.                 <div>
  29.                     <div class="top"><?php the_title(); ?></div>
  30.                     <div class="middle">
  31.                         <?php
  32.                             $thumbUrl = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
  33.                             if($thumbUrl) {
  34.                                 echo '<img src="'.$thumbUrl.'" alt="'.get_the_title().'" />';
  35.                             }
  36.                             else {
  37.                                 echo '<img src="'.get_bloginfo('template_url').'/images/nopost-image-home.jpg" alt="'.get_the_title().'" />';
  38.                             }
  39.                         ?>
  40.                     </div>
  41.                     <div class="bottom"><?php dynamic_excerpt(230); ?></div>
  42.                 </div>
  43.             </a>
  44.                 <?php
  45.                 }
  46.             else {
  47.                 if ($count < 4){
  48.                     echo '
  49.                         </header>
  50.                           <div id="contant">
  51.                             <div class="right">
  52.                               <div id="category"><a href="#" class="active">סרטים</a><a href="#">סדרות</a><a href="#">משחקים</a></div>
  53.                               <div id="list">
  54.                     ';
  55.                 } ?>
  56.                 <div class="item">
  57.                     <?php
  58.                         $thumbUrl = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
  59.                         if($thumbUrl) {
  60.                             echo '<img src="'.$thumbUrl.'" alt="'.get_the_title().'" />';
  61.                         }
  62.                         else {
  63.                             echo '<img src="'.get_bloginfo('template_url').'/images/nopost-image-home.jpg" alt="'.get_the_title().'" />';
  64.                         }
  65.                     ?>
  66.                   <div class="top"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
  67.                   <div class="bottom">
  68.                       <span><?php dynamic_excerpt(200); ?></span>
  69.                       <br/>
  70.                       <span><?php echo __('פורסם ע"י').'&nbsp;'.get_the_author_link().' | '.__('בתאריך ', 'sagive').get_the_date().' | '; ?><a href="<?php comments_link(); ?>"><?php comments_number( __('אין תגובות', 'sagive'), __('תגובה אחת', 'sagive'), __('% תגובות', 'sagive') );echo '</a>'; ?></span>
  71.                   </div>
  72.                 </div>
  73.                
  74.             <?
  75.             }
  76.             ?>
  77.             <?php $count++; ?>
  78.         <?php endwhile; ?>
  79.           </div>
  80.           <div id="pages">
  81.             <?php wp_pagenavi(); ?>
  82.           </div>
  83.         </div>
  84.         <div class="left">
  85.             <?php
  86.             if ( is_active_sidebar( 'home-sidebar' )) {
  87.                 echo '<ul id="home-sidebar" class="home-sidebar">';
  88.                 dynamic_sidebar( 'home-sidebar' );
  89.                 echo '</ul>';
  90.             } else {
  91.                 _e('Drag widgets to home sidebar to display data here.', 'sagive');
  92.             }
  93.             ?>
  94.         </div>
  95.       </div>
  96.     </div>
  97. </body>
  98. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement