Marcos_Alexandre

page-entretenimento

Oct 28th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.46 KB | None | 0 0
  1. <?php
  2. /** Template Name: Entretenimento */
  3. get_header();
  4. global $pmc_data;
  5. wp_enqueue_script('pmc_bxSlider');
  6. ?>
  7. <!-- main content start -->
  8. <div class="mainwrap <?php if(!isset($pmc_data['use_fullwidth'])) echo 'sidebar' ?>">
  9.     <div class="title-page">
  10.     <?php if (have_posts()) : ?>
  11.         <h1><?php the_title(); ?></h1>
  12.     </div>
  13.     <div class="nav-cats">
  14.         <ul class="custom-taxonomies custom-taxonomies-lifestyle">
  15.             <?php wp_list_categories('title_li=&taxonomy=tax_entretenimento'); ?>
  16.         </ul>
  17.     </div>
  18.     <div class="main clearfix">
  19.         <div class="pad"></div>        
  20.         <div class="content blog width-800">
  21.             <?php
  22.  
  23.                 $page = (get_query_var('page')) ? get_query_var('page') : 1;
  24.  
  25.                 $args = array (
  26.                     'post_type' => 'entretenimento',
  27.                     'posts_per_page' => 1,
  28.                     'paged' => $page
  29.                 );
  30.  
  31.                 $my_query = new WP_Query ($args);
  32.                 $GLOBALS['wp_query']->max_num_pages = $my_query->max_num_pages;
  33.  
  34.             ?>
  35.             <?php $i = 0; ?>
  36.            
  37.            
  38.             <?php while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
  39.             <?php $i++; ?>
  40.             <div class="estepost">
  41.             <?php if(is_sticky(get_the_id())) { ?>
  42.             <div class="pmc_sticky">
  43.             <?php } ?>
  44.             <?php
  45.             $postmeta = get_post_custom(get_the_id()); ?>
  46.             <div class="blog_category"><?php echo '<em>' . get_the_category_list( __( ', ', 'pmc-themes' ) ) . '</em>'; ?></div>           
  47.             <h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  48.             <?php
  49.             if ( has_post_format( 'gallery' , get_the_id())) {
  50.             ?>
  51.             <div class="slider-category">
  52.                
  53.                 <div class="blogpostcategory">
  54.                 <?php  
  55.                     global $post;
  56.                     $attachments = '';
  57.                     $post_subtitrare = get_post( get_the_id() );
  58.                     $content = $post_subtitrare->post_content;
  59.                     $pattern = get_shortcode_regex();
  60.                     preg_match( "/$pattern/s", $content, $match );
  61.                     if( isset( $match[2] ) && ( "gallery" == $match[2] ) ) {
  62.                         $atts = shortcode_parse_atts( $match[3] );
  63.                         $attachments = isset( $atts['ids'] ) ? explode( ',', $atts['ids'] ) : get_children( 'post_type=attachment&post_mime_type=image&post_parent=' . get_the_id() .'&order=ASC&orderby=menu_order ID' );
  64.                     }
  65.                     if ($attachments) {?>
  66.                     <div id="slider-category" class="slider-category">
  67.                     <div class="loading"></div>
  68.                         <ul id="slider" class="bxslider">
  69.                             <?php
  70.                                 foreach ($attachments as $attachment) {
  71.                                     $image =  wp_get_attachment_image_src( $attachment, 'blog' ); ?>   
  72.                                         <li>
  73.                                             <img src="<?php echo $image[0] ?>"/>                           
  74.                                         </li>
  75.                                         <?php } ?>
  76.                         </ul>
  77.                        
  78.                     </div>
  79.               <?php } ?>
  80.               <div class="bottomborder"></div>
  81.                 <?php get_template_part('includes/boxes/loopBlog'); ?>
  82.                 </div>
  83.             </div>
  84.             <?php }
  85.             if ( has_post_format( 'video' , get_the_id())) { ?>
  86.             <div class="slider-category">
  87.            
  88.                 <div class="blogpostcategory">
  89.                 <?php
  90.                
  91.                 if(!empty($postmeta["video_post_url"][0])) {?>
  92.                 <?php  
  93.                     $video_arg  = '';
  94.                     $video = wp_oembed_get( esc_url($postmeta["video_post_url"][0]), $video_arg );     
  95.                     $video = preg_replace('/width=\"(\d)*\"/', 'width="800"', $video);         
  96.                     $video = preg_replace('/height=\"(\d)*\"/', 'height="490"', $video);   
  97.                     echo $video;
  98.                 }
  99.                 else{
  100.                       $image = 'http://placehold.it/800x490';
  101.                      
  102.                 ?>
  103.                       <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php echo pmc_getImage(get_the_id(),'blog'); ?></a>
  104.                    
  105.                 <?php } ?> 
  106.                 <div class="bottomborder"></div>
  107.                 <?php get_template_part('includes/boxes/loopBlog'); ?>
  108.                 </div>
  109.             </div>
  110.             <?php }
  111.             if ( has_post_format( 'link' , get_the_id())) {?>
  112.             <div class="link-category">
  113.                 <div class="blogpostcategory">
  114.                 <?php get_template_part('includes/boxes/loopBlogLink'); ?>                             
  115.                 </div>
  116.             </div>
  117.            
  118.             <?php
  119.             }  
  120.             ?>
  121.             <?php if ( has_post_format( 'audio' , get_the_id())) {?>
  122.             <div class="blogpostcategory">
  123.                 <div class="audioPlayerWrap">
  124.                     <div class="loading"></div>
  125.                     <div class="audioPlayer">
  126.                         <?php
  127.                         if(isset($postmeta["audio_post_url"][0]))
  128.                             echo do_shortcode('[audio file="'. esc_url($postmeta["audio_post_url"][0]) .'"]') ?>
  129.                     </div>
  130.                 </div>
  131.                 <?php get_template_part('includes/boxes/loopBlog'); ?>     
  132.             </div> 
  133.             <?php
  134.             }
  135.             ?>                 
  136.            
  137.            
  138.             <?php
  139.            
  140.             if ( !get_post_format() ) {?>
  141.        
  142.             <div class="blogpostcategory">
  143.                    
  144.                 <?php if(pmc_getImage(get_the_id(), 'blog') != '') { ?>
  145.                     <a class="overdefultlink" href="<?php the_permalink() ?>">
  146.                     <div class="overdefult">
  147.                     </div>
  148.                     </a>
  149.                     <div class="blogimage">
  150.                         <div class="loading"></div>    
  151.                         <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php echo pmc_getImage(get_the_id(), 'blog'); ?></a>
  152.                     </div>
  153.                    
  154.                     <div class="bottomborder"></div>
  155.                     <?php } ?>
  156.                     <?php get_template_part('includes/boxes/loopBlog'); ?>
  157.             </div> 
  158.             <?php }
  159.            
  160.             ?>     
  161.             <?php if(is_sticky()) { ?>
  162.                 </div>
  163.             <?php } ?>
  164.  
  165.             <div class="blog_social"> <?php pmc_socialLinkSingle(get_the_permalink(),get_the_title())  ?></div>
  166.            
  167.             <?php if($i == 4)
  168.             {
  169.             ?>
  170.             <div class="spacer">
  171.             <?php echo putRevSlider("slider-patrocinio-rodape","homepage"); ?>
  172.             </div>
  173.            
  174.             <?php
  175.             }
  176.             ?>
  177.            
  178.             </div>
  179.            
  180.            
  181.            
  182.                 <?php endwhile; ?>
  183.  
  184.                     <?php else : ?>
  185.                    
  186.                         <div class="postcontent">
  187.                             <h1><?php echo $pmc_data['errorpagetitle'] ?></h1>
  188.                             <div class="posttext">
  189.                                 <?php echo $pmc_data['errorpage'] ?>
  190.                             </div>
  191.                         </div>
  192.                        
  193.                     <?php endif; ?>
  194.  
  195.        
  196.        
  197.                
  198.         <!-- AQUI VEM A PAGINAÇÃO -->
  199.            
  200.                 <?php if ( function_exists( 'wp_pagination' ) )
  201.                   wp_pagination($my_query);
  202.                 ?>
  203.  
  204.            
  205.         </div>
  206.         <!-- sidebar -->
  207.         <sidebar id="custom-sidebar">
  208.             <div class="propaganda">
  209.                 <?php putRevSlider( "ad_entretenimento" ); ?>
  210.             </div>
  211.             <br>
  212.             <div class="propaganda">
  213.                 <h4></h4>
  214.                 <?php putRevSlider( "shop_now" ); ?>
  215.             </div>
  216.             <br>
  217.             <div class="propaganda">
  218.                 <h4></h4>
  219.                 <?php putRevSlider( "snap" ); ?>
  220.             </div>
  221.         </sidebar>
  222.         <div class="sidebar sidebar-edited">   
  223.             <?php dynamic_sidebar( 'sidebar' ); ?>
  224.         </div>
  225.         <div class="clear"></div>
  226.  
  227.         <div class="complemento-page hidden-sm hidden-md">
  228.             <h2 class="custom-subtitle">TIME</h2>
  229.             <ul id="list_clients" class="owl_carousel">
  230.  
  231.                 <?php
  232.                     $clientesArgs = array('post_type' => 'team', 'showposts' => -1);
  233.                     $clientesLoop = new WP_Query( $clientesArgs );
  234.                     while ( $clientesLoop->have_posts() ) : $clientesLoop->the_post();
  235.                 ?>
  236.                    
  237.                     <li class="col-md-12">
  238.                         <a href="<?php the_permalink(); ?>" class="link-fancy fancybox">
  239.                             <div class="hover-effect">
  240.                                 <div class="outer-frame">
  241.                                     <div class="custom-border custom-border-dark"></div>
  242.                                     <div class="frame-img">
  243.                                         <?php the_post_thumbnail(); ?>
  244.                                     </div>
  245.                                 </div>
  246.                             </div>
  247.                             <div class="infos">
  248.                                 <div class="custom-border">
  249.                                     <h3><?php the_title(); ?></h3>
  250.                                     <span><p><?php echo rwmb_meta( $key='metabox_job', $args = array(), $post_id = null ); ?></p></span>
  251.                                 </div>
  252.                             </div>
  253.                         </a>
  254.                     </li>
  255.  
  256.                 <?php endwhile; ?>
  257.             </ul>
  258.         </div>
  259.  
  260.        
  261.     </div>
  262. </div>
  263. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment