Advertisement
academicdigital

Untitled

Jan 14th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 26.20 KB | None | 0 0
  1. <?php
  2.  
  3.     //Language Options
  4.     $velocity_readmore = __('Read More', 'velocity');
  5.     $velocity_category = __('Category', 'velocity');
  6.     $velocity_relates = __('Related Posts', 'velocity');
  7.     $velocity_categoryname = __('Category', 'velocity');
  8.     $velocity_archivename = __('Archives', 'velocity');
  9.     $velocity_tags = __('Tag', 'velocity');
  10.     $velocity_all = __('All', 'velocity');
  11.     $velocity_in = __('in', 'velocity');
  12.     $velocity_by = __('by', 'velocity');
  13.     $velocity_tagged = __('tagged: ', 'velocity');
  14.  
  15.     global $wp_query;
  16.     $velocity_content_array = $wp_query->get_queried_object();
  17.     if(isset($velocity_content_array->ID)){
  18.         $velocity_post_id = $velocity_content_array->ID;
  19.     }
  20.     else $velocity_post_id=0;
  21.     $velocity_template_uri = get_template_directory_uri();
  22.  
  23.     //if(have_posts())
  24.     $velocity_pagecustoms = velocity_getOptions($velocity_post_id);
  25.  
  26.     // Themeoptions
  27.     $velocity_themeoptions = velocity_getThemeOptions();
  28.  
  29.     //Blog Style Options
  30.     $velocity_nopostinfo = !isset($velocity_themeoptions['velocity_blogpostinfo_date']) && !isset($velocity_themeoptions['velocity_blogpostinfo_author']) && !isset($velocity_themeoptions['velocity_blogpostinfo_category']) && !isset($velocity_themeoptions['velocity_blogpostinfo_comments']) && !isset($velocity_themeoptions['velocity_blogpostinfo_tags']) ? "style='display:none;'" : "";
  31.     if ($velocity_nopostinfo == "style='display:none;'"){ $velocity_titlemod = "margin-bottom: 14px;"; } else { $velocity_titlemod = ""; }
  32.     $velocity_bloglayout = $velocity_themeoptions['velocity_blogpostlayout'];
  33.     //$velocity_blogdateclass = isset($velocity_themeoptions['velocity_blogsingledate']) ? "" : "nodate";
  34.     $velocity_blogdateclass = "nodate";
  35.     if ($velocity_nopostinfo == "style='display:none;'" && $velocity_blogdateclass == ""){ $velocity_titlemod = "margin-bottom: 36px;"; }
  36.  
  37.     $velocity_bloglayoutclass = "";
  38.  
  39.     //Default Sidebar
  40.         if(!isset($velocity_pagecustoms["velocity_activate_sidebar"])){
  41.             if (isset($velocity_themeoptions["velocity_blogpostsidebar"]) && $velocity_themeoptions["velocity_blogpostsidebar"]!="Full-Width"){
  42.                 $velocity_pagecustoms["velocity_activate_sidebar"] = 'on';
  43.                 $velocity_pagecustoms["velocity_sidebar"] = $velocity_themeoptions["velocity_blogpostsidebar_select"];
  44.                 $velocity_pagecustoms["velocity_sidebar_orientation"] = $velocity_themeoptions["velocity_blogpostsidebar"];
  45.             }  
  46.         }
  47.    
  48.     //Sidebar & Blog Style
  49.     if(isset($velocity_pagecustoms["velocity_activate_sidebar"])){
  50.         if (isset($velocity_pagecustoms["velocity_sidebar"])){$velocity_sidebar = $velocity_pagecustoms["velocity_sidebar"];}else{$velocity_sidebar = "Blog Sidebar";}
  51.         $velocity_sidebar_orientation = $velocity_pagecustoms["velocity_sidebar_orientation"];
  52.         $velocity_activate_sidebar="on";
  53.         $velocity_blogfullclass = "";
  54.         $velocity_bloglayoutclass = "";
  55.  
  56.         $velocity_related_span="span8";
  57.         $velocity_related_wrapspan="span8";
  58.  
  59.         $velocity_post_top_width = 850;
  60.         $velocity_post_top_height = "";
  61.         if($velocity_bloglayout == "Small Media"){
  62.             $velocity_bloglayoutclass = "smallmedia";
  63.             $velocity_post_top_width = 710;
  64.             $velocity_post_top_height = "";
  65.         }
  66.     }
  67.     else {
  68.         $velocity_activate_sidebar="off";
  69.         $velocity_blogfullclass = "fullblog";
  70.  
  71.         $velocity_related_span="span12";
  72.         $velocity_related_wrapspan="span12";
  73.  
  74.         $velocity_post_top_width = 1170;
  75.         $velocity_post_top_height = "";
  76.         if($velocity_bloglayout == "Small Media"){
  77.             $velocity_bloglayoutclass = "smallmedia";
  78.             $velocity_post_top_width = 710;
  79.             $velocity_post_top_height = "";
  80.         }
  81.     }
  82.  
  83.     // Pagetitle
  84.     if(isset($velocity_pagecustoms['velocity_activate_page_title'])){ $velocity_headline = "off";} else {$velocity_headline = "on";}
  85.     if(isset($velocity_pagecustoms['velocity_header_title']))$velocity_htitle = $velocity_pagecustoms['velocity_header_title']; else $velocity_htitle= "".get_the_title()."";
  86.     if(have_posts()) $velocity_current_cat = get_the_category();
  87.  
  88.     /* Theme Layout */
  89.     $velocity_slider="";
  90.     $velocity_themelayout = $velocity_themeoptions['velocity_themelayout'];
  91.     $velocity_slider_parallax = isset($velocity_themeoptions['velocity_parallax_effects']) ? true : false;
  92.     if($velocity_themelayout=="Full-Width") $velocity_stretchme_on_mobile = "stretchme_on_mobile";
  93.     else $velocity_stretchme_on_mobile = "";
  94.  
  95.     //Page Slider
  96.     if(isset($velocity_pagecustoms["velocity_activate_slider"]) && $velocity_pagecustoms["velocity_activate_slider"]=="on") {
  97.         $velocity_slider = $velocity_pagecustoms["velocity_header_slider"];
  98.         $velocity_slider_height = velocity_get_revslider_property($velocity_slider,"height");
  99.         if(velocity_get_revslider_property($velocity_slider,"slider_type")=="fullscreen") $velocity_slider_height = 50000;
  100.     }else{
  101.         $velocity_slider ="";
  102.         $velocity_slider_height = "";
  103.     }
  104.  
  105.     get_header();
  106.    
  107.     //Cutomizer Start
  108.      $getpreview = isset($_COOKIE['velocitypreview']) && $_COOKIE['velocitypreview']!='' ? $_COOKIE['velocitypreview'] : "velocity1.css";
  109.      
  110.      switch ($getpreview) {
  111.          case "velocity_blue_widedark.css":
  112.            $velocity_stretchme_on_mobile = "stretchme_on_mobile";
  113.          break;
  114.          
  115.           case "velocity_blue_boxeddark.css":
  116.             $velocity_stretchme_on_mobile = "";
  117.          break;
  118.          
  119.           case "velocity_brown.css":
  120.              $velocity_stretchme_on_mobile="";           
  121.          break;
  122.          
  123.           case "velocity_green.css":
  124.              $velocity_stretchme_on_mobile = "";             
  125.  
  126.          break;
  127.          
  128.           case "velocity_orange.css":
  129.             $velocity_stretchme_on_mobile = "stretchme_on_mobile";
  130.          break;
  131.          
  132.           case "velocity_smoked.css":
  133.             $velocity_stretchme_on_mobile = "stretchme_on_mobile";
  134.          break;
  135.          
  136.          
  137.          
  138.          default:
  139.          break;
  140.      }       
  141.      //Cutomizer END   
  142. ?>
  143.  
  144. <?php if($velocity_slider!="" /*&& $velocity_themelayout=="Full-Width"*/){ ?>
  145.     <div class="homesliderwrapper">
  146.         <div class="row homeslider" style="height:<?php echo $velocity_slider_height;?>px;">
  147.             <?php if(!strpos($velocity_slider, 'howbiz')) echo do_shortcode('[rev_slider '.$velocity_slider.']');
  148.                   else echo do_shortcode('[showbiz '.str_replace('showbiz_','',$velocity_slider).']');
  149.             ?>
  150.         </div>
  151.     </div>
  152.     <!--div class="row firstdivider"></div-->
  153.     <?php if ($velocity_slider_parallax){ ?><script>jQuery(document).ready(function(){initSliderFun();});</script><?php } ?>
  154. <?php } ?>
  155.  
  156. <!-- Main Container -->
  157. <section id="firstcontentcontainer" class="container <?php echo $velocity_stretchme_on_mobile; ?>">
  158.  
  159. <!-- Body -->
  160. <section class="row">
  161.  
  162.     <!-- Content -->
  163.     <?php if ($velocity_activate_sidebar=="on" && $velocity_sidebar_orientation =="right") { ?>
  164.     <section class="span9 left">
  165.     <section class="pagewrapright">
  166.     <?php } else if ($velocity_activate_sidebar=="on" && $velocity_sidebar_orientation =="left") { ?>
  167.     <section class="span9 right">
  168.     <section class="pagewrapleft">
  169.     <?php } else { ?>
  170.     <section class="span12 <?php echo $velocity_blogfullclass;?>">
  171.     <?php } ?>
  172.  
  173.         <!--
  174.         #################################
  175.             -   BLOG    -
  176.         #################################
  177.         -->
  178.  
  179.         <?php if(have_posts()) :
  180.         while(have_posts()) : the_post();
  181.  
  182.             //Post Time & Info
  183.             $velocity_post_time_day = get_post_time('j', true);
  184.             $velocity_post_time_month = date_i18n('M', strtotime($post->post_date_gmt));
  185.             $velocity_post_time_year = get_post_time('Y', true);
  186.             $velocity_post_time_daymonthyear = date_i18n(get_option('date_format'), strtotime($post->post_date_gmt));
  187.  
  188.             $velocity_postcustoms = velocity_getOptions($post->ID);
  189.             $velocity_post_top="";
  190.  
  191.             //Post Type related Object to display in the Head Area of the post
  192.             if(isset($velocity_postcustoms["velocity_post_type"]))
  193.             switch ($velocity_postcustoms["velocity_post_type"]) {
  194.                 case 'image':
  195.                     $velocity_blogimageurl="";
  196.                     $velocity_blogimageurl = aq_resize(wp_get_attachment_url( get_post_thumbnail_id($post->ID) ),$velocity_post_top_width,$velocity_post_top_height,true);
  197.                     if($velocity_blogimageurl!=""){
  198.                         $velocity_post_top = '<img src="'.$velocity_blogimageurl.'" alt="'.get_the_title().'">';
  199.                     }
  200.                 break;
  201.                 case 'video':
  202.                     $velocity_video_width = $velocity_postcustoms["velocity_video_width"];
  203.                     $velocity_video_height = $velocity_postcustoms["velocity_video_height"];
  204.  
  205.                     if($velocity_video_width>$velocity_post_top_width)
  206.                         $velocity_video_width_ratio = $velocity_video_width/$velocity_post_top_width;
  207.                     else
  208.                         $velocity_video_width_ratio = $velocity_post_top_width/$velocity_video_width;
  209.  
  210.                     $velocity_video_height = round($velocity_video_height*$velocity_video_width_ratio);
  211.                     $velocity_video_width = $velocity_post_top_width;
  212.  
  213.                     if($velocity_postcustoms["velocity_video_type"]=="youtube"){
  214.                         $velocity_post_top = '<div class="scalevid"><iframe src="http://www.youtube.com/embed/'.$velocity_postcustoms["velocity_youtube_id"].'?hd=1&amp;wmode=opaque&amp;autohide=1&amp;showinfo=0" width="'.$velocity_postcustoms["velocity_video_width"].'" height="'.$velocity_postcustoms["velocity_video_height"].'" style="border:0"></iframe></div>';
  215.                     }
  216.                     elseif ($velocity_postcustoms["velocity_video_type"]=="vimeo") {
  217.                         $velocity_post_top = '<div class="scalevid"><iframe src="http://player.vimeo.com/video/'.$velocity_postcustoms["velocity_vimeo_id"].'?title=0&amp;byline=0&amp;portrait=0&amp;color=ffffff" width="'.$velocity_postcustoms["velocity_video_width"].'" height="'.$velocity_postcustoms["velocity_video_height"].'" style="border:0"></iframe></div>';
  218.                     }
  219.                 break;
  220.  
  221.                 case 'slider':
  222.                         $velocity_slider = $velocity_postcustoms["velocity_slider"];
  223.                         $velocity_post_top = do_shortcode('[rev_slider '.$velocity_slider.']');
  224.                 break;
  225.  
  226.                 default:
  227.                 $velocity_post_top = "";
  228.                 break;
  229.             }
  230.  
  231.             $velocity_entrycategory = "";
  232.             if(is_tax()){
  233.                 $velocity_entrycategory = get_the_term_list( '', "category_".$velocity_tax_slug, '<div class="blogcategory">', '</div><div class="blogcategory">', '</div>' );
  234.             } else {
  235.                 foreach((get_the_category()) as $velocity_category) {
  236.                     $velocity_entrycategory .= ', <a href="'.get_category_link($velocity_category->term_id ).'">'.$velocity_category->cat_name.'</a>';
  237.                 }
  238.                 $velocity_entrycategory = substr($velocity_entrycategory, 2);
  239.             } ?>
  240.  
  241.             <?php if($velocity_bloglayout == "Small Media" && $velocity_post_top==""){
  242.                 $velocity_bloglayoutclass = "nosmallmedia";
  243.             }
  244.            
  245.             //Post Pagination args
  246.                 $velocity_postpaginationargs = array(
  247.                     'before'           => '<div class="postdivider"></div><div class="pagenavi paginatedpost"><span class="pages">' . __('Continue Reading','velocity').'</span><div class="pagination"><ul>',
  248.                     'after'            => '</ul></div></div>',
  249.                     'link_before'      => '<span>',
  250.                     'link_after'       => '</span>',
  251.                     'next_or_number'   => 'number',
  252.                     'nextpagelink'     => __('Next','velocity'),
  253.                     'previouspagelink' => __('Previous','velocity'),
  254.                     'pagelink'         => '<li>%</li>',
  255.                     'echo'             => 1
  256.                 );
  257.             ?>
  258.  
  259.             <article class="blogpost singlepost <?php echo $velocity_bloglayoutclass;?> <?php echo $velocity_blogdateclass;?>" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  260.  
  261.                 <?php if($velocity_bloglayout == "Large Media"){ ?>
  262.                    
  263.                 <?php } ?>
  264.  
  265.                 <section class="post">
  266.  
  267.                     <?php if($velocity_bloglayout == "Small Media"){ ?>
  268.                         <?php if ($velocity_post_top!=""){?>
  269.                             <div class="postmedia">
  270.                                 <?php echo $velocity_post_top; ?>
  271.                             </div>
  272.                         <?php } ?>
  273.                     <?php } ?>
  274.  
  275.                     <section class="postbody">
  276.  
  277.                         <?php if($velocity_bloglayout == "Small Media"){ ?>
  278.                             <div class="date">
  279.                                 <div class="day"><?php echo $velocity_post_time_day;?></div>
  280.                                 <div class="month"><?php echo $velocity_post_time_month;?></div>
  281.                             </div>
  282.                             <!--h2 style="<?php echo $velocity_titlemod; ?>"><?php the_title(); ?></h2-->
  283.                             <div class="postinfo" <?php echo $velocity_nopostinfo; ?>>
  284.                                 <?php if (isset($velocity_themeoptions['velocity_blogpostinfo_date'])){ ?><div class="time"><?php echo $velocity_post_time_daymonthyear; ?></div><?php } ?>
  285.                                 <?php if (isset($velocity_themeoptions['velocity_blogpostinfo_author'])){ ?><div class="author"><?php echo $velocity_by ?> <?php the_author_posts_link(); ?></div><?php } ?>
  286.                                 <?php if (isset($velocity_themeoptions['velocity_blogpostinfo_category'])){ ?><div class="categories"><?php echo $velocity_in ?> <?php echo $velocity_entrycategory; ?></div><?php } ?>
  287.                                 <?php if (isset($velocity_themeoptions['velocity_blogpostinfo_comments']) && comments_open()){ ?><div class="comments"><?php comments_popup_link(__('no Comments', 'velocity'), __('one Comment', 'velocity'), __( '% Comments', 'velocity')); ?></div><?php } ?>
  288.                                 <?php if (isset($velocity_themeoptions['velocity_blogpostinfo_tags']) && has_tag()){ ?><div class="tags"><?php echo $velocity_tagged ?> <?php echo the_tags('', ', ', ''); ?></div><?php } ?>
  289.                             </div>
  290.                         <?php } ?>
  291.  
  292.                         <?php if($velocity_bloglayout == "Large Media"){ ?>
  293.                             <?php if ($velocity_post_top!=""){?>
  294.                                 <?php if ($velocity_postcustoms["velocity_post_type"]!='slider') {?>
  295.                                 <div class="postmedia">
  296.                                     <?php echo $velocity_post_top; ?>
  297.                                 </div>
  298.                                 <?php } else {?>
  299.                                 <div class="postmedia-slide">
  300.                                     <?php echo $velocity_post_top; ?>
  301.                                 </div>
  302.                                 <?php } ?>
  303.                             <?php } ?>
  304.                            
  305.                             <div class="date">
  306.                                 <div class="day"><?php echo $velocity_post_time_day;?></div>
  307.                                 <div class="month"><?php echo $velocity_post_time_month;?></div>
  308.                             </div>
  309.                             <h2 style="<?php echo $velocity_titlemod; ?>"><!--<?php the_title(); ?>--></h2>
  310.                             <div class="postinfo" <?php echo $velocity_nopostinfo; ?>>
  311.                                 <?php if (isset($velocity_themeoptions['velocity_blogpostinfo_date'])){ ?><div class="time"><?php echo $velocity_post_time_daymonthyear; ?></div><?php } ?>
  312.                                 <?php if (isset($velocity_themeoptions['velocity_blogpostinfo_author'])){ ?><div class="author"><?php echo $velocity_by ?> <?php the_author_posts_link(); ?></div><?php } ?>
  313.                                 <?php if (isset($velocity_themeoptions['velocity_blogpostinfo_category'])){ ?><div class="categories"><?php echo $velocity_in ?> <?php echo $velocity_entrycategory; ?></div><?php } ?>
  314.                                 <?php if (isset($velocity_themeoptions['velocity_blogpostinfo_comments']) && comments_open()){ ?><div class="comments"><?php comments_popup_link(__('no Comments', 'velocity'), __('one Comment', 'velocity'), __( '% Comments', 'velocity')); ?></div><?php } ?>
  315.                                 <?php if (isset($velocity_themeoptions['velocity_blogpostinfo_tags']) && has_tag()){ ?><div class="tags"><?php echo $velocity_tagged ?> <?php echo the_tags('', ', ', ''); ?></div><?php } ?>
  316.                             </div>
  317.                            
  318.                         <?php } ?>
  319.  
  320.                         <div class="posttext"><?php the_content(); ?></div>
  321.                         <?php wp_link_pages( $velocity_postpaginationargs ); ?>
  322.                     </section>
  323.                 </section>
  324.             </article>
  325.  
  326.             <!-- Post Comments -->
  327.             <?php comments_template('', true); ?>
  328.             <!-- Post Comments End -->
  329.  
  330.             <!-- Loop End -->
  331.             <?php endwhile; ?>
  332.  
  333.             <?php if (isset($velocity_themeoptions['velocity_blogrelated'])){ ?>
  334.  
  335.                 <!-- Related Posts -->
  336.                 <?php
  337.                 $velocity_tags = wp_get_post_tags($post->ID);
  338.  
  339.                 if ($velocity_tags) {
  340.                     $velocity_tag_ids = array();
  341.                     foreach($velocity_tags as $velocity_individual_tag) {
  342.                         $velocity_tag_ids[] = $velocity_individual_tag->term_id;
  343.                     }
  344.  
  345.                     $velocity_args=array(
  346.                         'tag__in' => $velocity_tag_ids,
  347.                         'post__not_in' => array($post->ID),
  348.                         'showposts'=> 4,
  349.                         'ignore_sticky_posts'=> 1,
  350.                         'suppress_filters' => 0
  351.                     );
  352.                     $velocity_temp = $wp_query;
  353.                     $velocity_my_query = new wp_query($velocity_args);
  354.                     if( $velocity_my_query->have_posts() ) {
  355.                         ?>
  356.                         <div class="clear"></div>
  357.                         <div class="wpb_separator wpb_content_element"></div>
  358.  
  359.                         <div class="relatedposts">
  360.                        
  361.                         <div class="contenttitle"><div class="titletext"><h2><?php echo $velocity_relates; ?></h2></div></div>
  362.  
  363.                         <div class="<?php echo $velocity_related_wrapspan ?> relatedwrap">
  364.                             <div class="homeposts">
  365.  
  366.                             <?php
  367.                             $counter = 0;
  368.                             while ($velocity_my_query->have_posts()) { $velocity_my_query->the_post();
  369.  
  370.                                 $velocity_newspostcustoms = velocity_getOptions($post->ID);
  371.                                 $velocity_newscategory = get_the_category($post->ID);
  372.                                 $velocity_newsfirst_category = $velocity_newscategory[0]->cat_name;
  373.                                 $velocity_newsrepl = strtolower((preg_replace('/\s+/', '-', $velocity_newsfirst_category)));
  374.                                 $velocity_newsbase = home_url();
  375.                                 $velocity_newsimageurl = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
  376.  
  377.                                 $velocity_post_time_day = date_i18n('j', strtotime($post->post_date_gmt));
  378.                                 $velocity_post_time_month = date_i18n('M', strtotime($post->post_date_gmt));
  379.                                 $velocity_post_time_year = date_i18n('Y', strtotime($post->post_date_gmt));
  380.  
  381.                                 $velocity_newsexcerpt = velocity_excerpt(15);
  382.                                 $velocity_thenewsimageurl = aq_resize( $velocity_newsimageurl, 50, 50, true );
  383.  
  384.                                 $velocity_newscatlist = "";
  385.                                 foreach((get_the_category($post->ID)) as $velocity_category) {
  386.                                     $velocity_newscatlist .= ', <a href="'.get_category_link($velocity_category->term_id ).'">'.$velocity_category->cat_name.'</a>';
  387.                                 }
  388.                                 $velocity_newscatlist = substr($velocity_newscatlist, 2);
  389.  
  390.                                 $velocity_num_comments = get_comments_number($post->ID);
  391.                                 if ( comments_open() ) {
  392.                                  if ( $velocity_num_comments == 0 ) {
  393.                                   $velocity_comments = __('No Comments','velocity');
  394.                                  } elseif ( $velocity_num_comments > 1 ) {
  395.                                   $velocity_comments = $velocity_num_comments . __(' Comments','velocity');
  396.                                  } else {
  397.                                   $velocity_comments = __('1 Comment','velocity');
  398.                                  }
  399.                                  $velocity_write_comments = '<a href="' . get_comments_link($post->ID) .'">'. $velocity_comments.'</a>';
  400.                                 } else {
  401.                                  $velocity_write_comments =  __('Comments are off for this post.','velocity');
  402.                                 }
  403.  
  404.                                 $postcustoms = velocity_getOptions($post->ID);
  405.                                 $post_top_width = 140;
  406.                                 $post_top_height = 140;
  407.                                 $post_top = '<a href="'.get_permalink($post->ID).'" title="'.get_the_title().'"><div class="posticonbg"><i class="icon-forward posticon"></i><img src="'.get_template_directory_uri().'/img/posticonbg.png"></div></a>';
  408.                                 $blogimageurl="";
  409.                                 $blogimageurl = aq_resize(wp_get_attachment_url(get_post_thumbnail_id($post->ID) ),$post_top_width,$post_top_height,true);
  410.                                 //Post Type related Object to display in the Head Area of the post
  411.                                     if(isset($postcustoms["velocity_post_type"])){
  412.                                             switch ($postcustoms["velocity_post_type"]) {
  413.                                                 case 'image':
  414.                                                     if($blogimageurl!=""){                                     
  415.                                                         $post_top = '<a href="'.get_permalink($post->ID).'" title="'.get_the_title($post->ID).'" class="withimage"><div class="posticonbg"><i class="icon-forward posticon"></i></div><img src="'.$blogimageurl.'" alt="" width="70" height="70"></a>';                     }
  416.                                                     else{
  417.                                                         $post_top = '<a href="'.get_permalink($post->ID).'" title="'.get_the_title().'"><div class="posticonbg"></div><i class="icon-forward posticon"></i><img src="'.get_template_directory_uri().'/img/posticonbg.png"></a>';   
  418.                                                     }
  419.                                                 break;
  420.                                                 case 'video':
  421.                                                     if($blogimageurl!=""){                                     
  422.                                                         $post_top = '<a href="'.get_permalink($post->ID).'" title="'.get_the_title($post->ID).'" class="withimage"><div class="posticonbg"><i class="icon-video-1 posticon"></i></div><img src="'.$blogimageurl.'" alt="" width="70" height="70"></a>';                     }
  423.                                                     else{
  424.                                                         $post_top = '<a href="'.get_permalink($post->ID).'" title="'.get_the_title().'"><div class="posticonbg"></div><i class="icon-video-1 posticon"></i><img src="'.get_template_directory_uri().'/img/posticonbg.png"></a>';
  425.                                                     }
  426.                                                 break;
  427.                                                 case 'slider':
  428.                                                     if($blogimageurl!=""){                                     
  429.                                                         $post_top = '<a href="'.get_permalink($post->ID).'" title="'.get_the_title($post->ID).'" class="withimage"><div class="posticonbg"><i class="icon-retweet posticon"></i></div><img src="'.$blogimageurl.'" alt="" width="70" height="70"></a>';                     }  
  430.                                                     else{
  431.                                                         $post_top = '<a href="'.get_permalink($post->ID).'" title="'.get_the_title().'"><div class="posticonbg"></div><i class="icon-retweet posticon"></i><img src="'.get_template_directory_uri().'/img/posticonbg.png"></a>';
  432.                                                     }
  433.                                                 break;
  434.                                                 default:
  435.                                                     $blogimageurl="";
  436.                                                     $blogimageurl = aq_resize(wp_get_attachment_url( get_post_thumbnail_id($post->ID) ),$post_top_width,$post_top_height,true);
  437.                                                     if(!empty($blogimageurl)){
  438.                                                         $post_top = '<a href="'.get_permalink($post->ID).'" title="'.get_the_title().'"><img src="'.$blogimageurl.'" alt=""></a>';
  439.                                                     }
  440.                                                     else $post_top = '<a href="'.get_permalink($post->ID).'" title="'.get_the_title().'"><div class="posticonbg"></div><i class="icon-forward posticon"></i><img src="'.get_template_directory_uri().'/img/posticonbg.png" width="70" height="70"></a>';
  441.                                                 break;
  442.                                             }
  443.                 //                      print_r($post_top);
  444.                                     }
  445.  
  446.                                 $counter++;
  447.                                 $class="";
  448.  
  449.                                 if ($counter%2 != 0) {
  450.                                      $class="";
  451.                                 } else {
  452.                                      $counter=0;
  453.                                      $class="lastcolumn";
  454.                                 }
  455.  
  456.                             ?>
  457.                                 <div class="one_half <?php echo $class; ?>">
  458.                                     <div class="homepostholder ">
  459.                                         <div class="homepostimage">
  460.                                             <?php echo $post_top; ?>
  461.                                             <div class="date">
  462.                                                 <div class="day"><?php echo $velocity_post_time_day; ?></div>
  463.                                                 <div class="month"><?php echo $velocity_post_time_month; ?></div>
  464.                                             </div>
  465.                                         </div>
  466.                                    
  467.                                     <div class="homepost">
  468.                                         <div class="post">
  469.                                             <div class="postbody">
  470.                                                 <h4><a href="<?php the_permalink(); ?>"><?php echo $post->post_title ?></a></h4>
  471.                                                 <div class="postinfo">
  472.                                                     <div class="categories"><?php echo $velocity_newscatlist; ?></div>
  473.                                                     <div class="comments"><?php echo $velocity_write_comments ?></div>
  474.                                                 </div>
  475.                                                 <?php echo velocity_excerpt(20); ?>
  476.                                                 <div class="clear"></div>
  477.                                             </div>
  478.                                         </div>
  479.                                     </div>
  480.                                     <div class="clear"></div>
  481.                                 </div></div>
  482.                             <?php }
  483.                             $wp_query = null;
  484.                             $wp_query = $velocity_temp;
  485.                             wp_reset_query();
  486.                             ?>
  487.  
  488.                         <div class="clear"></div></div></div>
  489.                     <?php } ?>
  490.                 <?php } ?>
  491.                 <!-- Related Posts End -->
  492.             <?php } ?>
  493.  
  494.         <!-- Content End -->
  495.         <?php if ($velocity_activate_sidebar=="on" && $velocity_sidebar_orientation =="right") { ?>
  496.         </section>
  497.             <?php if(function_exists('pagination')){ pagination(); }else{ paginate_links(); } ?>
  498.         </section>
  499.         <?php } else if ($velocity_activate_sidebar=="on" && $velocity_sidebar_orientation =="left") { ?>
  500.         </section>
  501.             <?php if(function_exists('pagination')){ pagination(); }else{ paginate_links(); } ?>
  502.         </section>
  503.         <?php } else { ?>
  504.             <?php if(function_exists('pagination')){ pagination(); }else{ paginate_links(); } ?>
  505.         </section>
  506.         <?php } ?>
  507.  
  508.         <?php else : ?>
  509.             <article class="span12">
  510.                 <p><?php _e('Oops, we could not find what you were looking for...', 'velocity'); ?></p>
  511.             </article>
  512.         <?php endif; ?>
  513.  
  514.         <?php if ($velocity_activate_sidebar=="on"){?>
  515.         <!--
  516.         #####################
  517.             -   SIDEBAR -
  518.         #####################
  519.         -->
  520.        
  521.         <?php if ($velocity_activate_sidebar=="on") { $velocity_sbmod = "style='margin-top: 0px !important;'"; } else { $velocity_sbmod = ""; }?>
  522.        
  523.         <aside class="span3 right sidebar" <?php echo $velocity_sbmod ?>>
  524.             <section class="row">
  525.  
  526.                 <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar($velocity_sidebar) ) : ?>
  527.                     <article class="span3 widget">
  528.                         <div class="footertitle"><h4>Sidebar Widget Area</h4></div>
  529.                         <div class="widgetclass">
  530.                         Please configure this Widget Area in the Admin Panel under Appearance -> Widgets
  531.                         </div><div class="clear"></div>
  532.                     </article>
  533.                 <?php endif; ?>
  534.  
  535.             </section>
  536.         </aside>
  537.         <!-- /Sidebar -->
  538.         <?php } ?>
  539.  
  540.     </section><div class="clear"></div>
  541.     <!-- /Body -->
  542.  
  543.     <!-- Bottom Spacing -->
  544.     <div class="row top50"></div>
  545.  
  546. </section><!-- /container -->
  547.  
  548. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement