Advertisement
Guest User

MCB Problem

a guest
May 13th, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.56 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: TotallyNew
  4. */
  5. ?>
  6.  
  7. <?php get_header(); ?>
  8.    
  9.  
  10.  
  11.  
  12.     <div id="centered-section">
  13.  
  14.  
  15.         <div id="intro-section">
  16.  
  17.             <?php the_block("TestBlock", array("type" => "one-liner")); ?>
  18.             <?php the_block("TestBlock3", array("type" => "one-liner")); ?>
  19.  
  20.  
  21.             <div id="intro-caption-1" class="intro-caption">
  22.                 <?php the_block("Caption 1", array("type" => "one-liner")); ?>
  23.             </div>
  24.  
  25.             <div id="intro-caption-2" class="intro-caption">
  26.                 <?php the_block("Caption 2", array("type" => "one-liner")); ?>
  27.             </div>
  28.  
  29.             <?php $random_count = 0;
  30.             $randomposts = get_posts( "category_name=Articles&orderby=rand&numberposts=3" );
  31.             foreach($randomposts as $post) {
  32.             setup_postdata($post); ?>
  33.            
  34.            
  35.             <a href="<?php echo get_permalink(); ?>">
  36.            
  37.             <?php the_post_thumbnail('medium', array('class' => 'circle-image', 'id' => 'circle'.$random_count));
  38.             $random_count += 1;
  39.             ?>
  40.            
  41.             </a>
  42.            
  43.             <?php } ?>
  44.  
  45.             <div id="circle-logo" class="circle-image"></div>
  46.  
  47.  
  48.             <div id="intro-text">
  49.                 <?php while ( have_posts() ) : the_post(); ?>
  50.                     <?php the_content(); ?>
  51.                 <?php endwhile; // end of the loop. ?>
  52.             </div>
  53.            
  54.             <a href="./articles">
  55.                 <div id="intro-button">
  56.                     Discover the TrowelBlazers
  57.                     <img src="<?php bloginfo('template_url');?>/images/arrow_right.png" class="arrow-right" alt="">
  58.                 </div>
  59.             </a>
  60.         </div>
  61.  
  62.  
  63.         <div id="latest-section">
  64.  
  65.             <?php
  66.             $lastposts = get_posts( "category_name=Articles&numberposts=1" );
  67.             foreach($lastposts as $post) : setup_postdata($post); ?>
  68.  
  69.             <?php the_post_thumbnail('medium', array('id' => 'latest-image')); ?>
  70.  
  71.             <div id="latest-header">
  72.                 Latest Article
  73.             </div>
  74.  
  75.             <div id="latest-text">
  76.                 <p id="latest-title"><?php the_title(); ?></p>
  77.                 <p><?php echo $trimmed = wp_trim_words( $text = get_the_content(), $num_words = 120); ?></p>
  78.                 <a href="<?php the_permalink(); ?>">
  79.                     <div id="latest-button" class="read-more">
  80.                         Read More
  81.                     </div>
  82.                 </a>
  83.             </div>
  84.  
  85.             <?php endforeach; ?>
  86.  
  87.         </div>
  88.  
  89.  
  90.         <div id="sub-section">
  91.  
  92.             <?php
  93.             $lastposts = get_posts( "category_name=Blog&numberposts=1" );
  94.             foreach($lastposts as $post) : setup_postdata($post);
  95.             $sub_box_image_id = get_post_thumbnail_id();
  96.             $sub_box_image = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'blog-image' );
  97.             $sub_box_image_url = $sub_box_image['0']; ?>
  98.  
  99.             <div id="sub-box-left" class="sub-box">
  100.                 <a href="<?php echo home_url(); ?>/blog">
  101.                     <div class="sub-box-title">
  102.                         What We're Up To
  103.                     </div>
  104.                 </a>
  105.                 <div id="sub-box-image-blog" class="sub-box-image" style="background: url('<?php echo $sub_box_image_url; ?>');"></div>
  106.                 <div class="sub-box-subtitle">
  107.                     <a href="<?php echo home_url(); ?>/blog"><?php the_title(); ?></a>
  108.                 </div>
  109.                 <div class="sub-box-text">
  110.                     <p><?php echo $trimmed = wp_trim_words( $text = get_the_content(), $num_words = 60); ?></p>
  111.                     <a href="<?php echo home_url(); ?>/blog">
  112.                         <div id="latest-button" class="read-more">
  113.                             Read More
  114.                         </div>
  115.                     </a>
  116.                 </div>
  117.             </div>
  118.  
  119.             <?php endforeach; ?>
  120.  
  121.  
  122.             <div id="sub-box-right" class="sub-box">
  123.                 <a href="<?php echo home_url(); ?>/community">
  124.                     <div class="sub-box-title">
  125.                         Community
  126.                     </div>
  127.                 </a>
  128.                 <div id="sub-box-image-community" class="sub-box-image"></div>
  129.                 <div class="sub-box-subtitle">
  130.                     <a href="<?php echo home_url(); ?>/community"><?php the_block("Community Subtitle", array("type" => "one-liner")); ?></a>
  131.                 </div>
  132.                 <div class="sub-box-text">
  133.                     <?php the_block("Community Text"); ?>
  134.                 </div>
  135.             </div>
  136.  
  137.         </div>
  138.        
  139.        
  140.         <div id="random-articles-section">
  141.  
  142.             <div id="random-divider" class="title-divider">
  143.                 <div class="double-divider"></div>
  144.                 <div class="title-bar">
  145.                     Recent Articles
  146.                 </div>
  147.                 <div class="double-divider double-divider-right"></div>
  148.             </div>
  149.  
  150.             <div id="browse-boxes">
  151.  
  152.                 <?php
  153.                 $lastposts = get_posts( "category_name=Articles&numberposts=4" );
  154.                 foreach($lastposts as $post) : setup_postdata($post);
  155.                     $browse_image_url = kd_mfi_get_featured_image_url( 'featured-image-2', 'post', 'thumbnail' ); ?>
  156.  
  157.                 <a href="<?php the_permalink(); ?>">
  158.                     <div class="browse-box" style="background: url('<?php echo $browse_image_url; ?>');">
  159.                         <div class="browse-title">
  160.                             <?php the_title(); ?>  
  161.                         </div>
  162.                     </div>
  163.                 </a>
  164.                 <?php endforeach; ?>
  165.  
  166.             </div>
  167.        
  168.         </div>
  169.  
  170.         <?php the_block("TestBlock2", array("type" => "one-liner")); ?>
  171.        
  172.         <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement