alchymyth

dodgy file single.php

Mar 1st, 2016
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.58 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3.  
  4.     <div class="row news" style="margin-top: 60px;">
  5.         <div class="col-md-4" >
  6.             <div style="background: rgb(203,203,203);height:350px;"></div>
  7.         </div>
  8.         <div class="col-md-8 content">
  9.  
  10. <?php
  11. //the loop starts here//
  12. if( have_posts() ) while( have_posts() ) { the_post(); ?>
  13.             <div <?php post_class(); ?>>
  14.                 <h2><?php the_title(); ?></h2>
  15.                 <?php the_content(); ?>
  16.             </div>
  17. <?php }
  18. //the loop ends here//
  19. ?>
  20.         </div>
  21.     </div>
  22.     <div class="row">
  23.         <div class="col-md-4">
  24.             <div class="left inner-col">
  25.                 <div class="top-block">
  26.                     <h2>Quick Links</h2>
  27.                     <h4>Become a member</h4>
  28.                     <div>It's easy and quick</div>
  29.                     <a class="join-now" href="#">Join Now</a>
  30.                     <i class="demo-icon icon-angle-right"></i>
  31.                 </div>
  32.                 <div class="sep"></div>
  33.                 <div class="bottom-block">
  34.                     <h4>Make a Payment</h4>
  35.                     <div>Secure and Simple</div>
  36.                     <a href="#">Join Now</a>
  37.                     <i class="demo-icon icon-angle-right"></i>
  38.                 </div>
  39.             </div>
  40.         </div>
  41.            
  42.         <div class="col-md-4">
  43.             <div class="middle inner-col">
  44.                 <?php
  45.                     $args = array( 'post_type' => 'calendar',
  46.                         'posts_per_page' => 2,
  47.                         'orderby' => 'date',
  48.                         'order' => 'DESC', );
  49.                     $calendars = query_posts( $args );
  50.                    
  51.                     if ($calendars) :
  52.                 ?>
  53.                 <div class="top-block">
  54.                     <h2>Calendar</h2>
  55.                     <i class="demo-icon icon-calendar-empty"></i><?php echo date('M jS h:ia', $calendars[0]->post_date); ?><br/>
  56.                     <b><?php echo $calendars[0]->post_title; ?></b><br/>
  57.                     <?php if (strlen($calendars[0]->post_content) >= 100) {                    
  58.                         echo substr($calendars[0]->post_content, 0, 97) . '...';
  59.                     } else {
  60.                         echo $calendars[0]->post_content;
  61.                     } ?>                       
  62.                 </div>
  63.                 <div class="sep"></div>
  64.                 <div class="bottom-block">
  65.                     <i class="demo-icon icon-calendar-empty"></i><?php echo date('M jS h:ia', $calendars[1]->post_date); ?><br/>
  66.                     <b><?php echo $calendars[1]->post_title; ?></b><br/>
  67.                     <?php if (strlen($calendars[1]->post_content) >= 100) {                    
  68.                         echo substr($calendars[1]->post_content, 0, 97) . '...';
  69.                     } else {
  70.                         echo $calendars[1]->post_content;
  71.                     } ?>
  72.                 </div>
  73.                 <!--a class="all-event" href="#">All Events</a-->
  74.                 <?php endif;?>
  75.             </div>
  76.         </div>
  77.            
  78.         <div class="col-md-4">
  79.             <div class="right inner-col">                  
  80.                 <?php
  81.                     $args=array(
  82.                         'posts_per_page' => 2,
  83.                         'orderby' => 'date',
  84.                         'order' => 'DESC',
  85.                     );
  86.                     $posts=get_posts($args);
  87.                     if ($posts):                   
  88.                 ?>
  89.                 <div class="top-block">
  90.                     <h2>News</h2>
  91.                     <b><?php echo $posts[0]->post_title;?></b><br/>
  92.                     <?php if (strlen($posts[0]->post_content) >= 100) {                    
  93.                         echo substr($posts[0]->post_content, 0, 97) . '...';
  94.                     } else {
  95.                         echo $posts[0]->post_content;
  96.                     } ?>
  97.                     <a href="<?php echo esc_url(get_permalink($posts[0]->ID)); ?>">Full Story</a>                      
  98.                 </div>
  99.                 <div class="sep"></div>
  100.                 <div class="bottom-block">
  101.                     <b><?php echo $posts[1]->post_title;?></b><br/>
  102.                     <?php if (strlen($posts[1]->post_content) >= 100) {                    
  103.                         echo substr($posts[1]->post_content, 0, 97) . '...';
  104.                     } else {
  105.                         echo $posts[1]->post_content;
  106.                     } ?>
  107.                     <a href="<?php echo esc_url(get_permalink($posts[1]->ID)); ?>">Full Story</a>  
  108.                 </div>
  109.                 <!--a class="all-event" href="#">All Articles</a-->
  110.                 <?php endif;?>
  111.             </div>
  112.         </div>
  113.     </div>
  114.     <div class="row member">
  115.         <div class="col-md-12">
  116.             <h2>A Proud member of</h2>
  117.             <div class="logo"></div>
  118.             <a href="#">View Welcome Letter </a>
  119.         </div>
  120.     </div>
  121.  
  122. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment