Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /** Template Name: Home */
- get_header();
- global $pmc_data;
- wp_enqueue_script('pmc_bxSlider');
- ?>
- <!-- main content start -->
- <div class="mainwrap blog <?php if(is_front_page()) echo 'home' ?> <?php if(!isset($pmc_data['use_fullwidth'])) echo 'sidebar' ?>">
- <div class="main clearfix">
- <div class="pad"></div>
- <div class="content blog">
- <?php if (have_posts()) : ?>
- <h2 class="title">New Post's</h2>
- <?php
- $argsFeature = array (
- 'post_type' => array( 'gastronomia', 'entretenimento', 'lifestyle' ),
- 'posts_per_page' => 1,
- 'featured'=>'yes'
- );
- $my_queryFeature = new WP_Query ($argsFeature);
- while ( $my_queryFeature->have_posts() ) : $my_queryFeature->the_post(); ?>
- <?php if(is_sticky(get_the_id())) { ?>
- <div class="pmc_sticky">
- <?php } ?>
- <?php
- $postmeta = get_post_custom(get_the_id()); ?>
- <div class="blog_category"><?php echo '<em>' . get_the_category_list( __( ', ', 'pmc-themes' ) ) . '</em>'; ?></div>
- <h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
- <?php
- if ( has_post_format( 'gallery' , get_the_id())) {
- ?>
- <div class="slider-category">
- <div class="blogpostcategory">
- <?php
- global $post;
- $attachments = '';
- $post_subtitrare = get_post( get_the_id() );
- $content = $post_subtitrare->post_content;
- $pattern = get_shortcode_regex();
- preg_match( "/$pattern/s", $content, $match );
- if( isset( $match[2] ) && ( "gallery" == $match[2] ) ) {
- $atts = shortcode_parse_atts( $match[3] );
- $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' );
- }
- if ($attachments) {?>
- <div id="slider-category" class="slider-category">
- <div class="loading"></div>
- <ul id="slider" class="bxslider">
- <?php
- foreach ($attachments as $attachment) {
- $image = wp_get_attachment_image_src( $attachment, 'blog' ); ?>
- <li>
- <img src="<?php echo $image[0] ?>"/>
- </li>
- <?php } ?>
- </ul>
- </div>
- <?php } ?>
- <div class="bottomborder"></div>
- <?php get_template_part('includes/boxes/loopBlog'); ?>
- </div>
- </div>
- <?php }
- if ( has_post_format( 'video' , get_the_id())) { ?>
- <div class="slider-category">
- <div class="blogpostcategory">
- <?php
- if(!empty($postmeta["video_post_url"][0])) {?>
- <?php
- $video_arg = '';
- $video = wp_oembed_get( esc_url($postmeta["video_post_url"][0]), $video_arg );
- $video = preg_replace('/width=\"(\d)*\"/', 'width="800"', $video);
- $video = preg_replace('/height=\"(\d)*\"/', 'height="490"', $video);
- echo $video;
- }
- else{
- $image = 'http://placehold.it/800x490';
- ?>
- <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php echo pmc_getImage(get_the_id(),'blog'); ?></a>
- <?php } ?>
- <div class="bottomborder"></div>
- <?php get_template_part('includes/boxes/loopBlog'); ?>
- </div>
- </div>
- <?php }
- if ( has_post_format( 'link' , get_the_id())) {?>
- <div class="link-category">
- <div class="blogpostcategory">
- <?php get_template_part('includes/boxes/loopBlogLink'); ?>
- </div>
- </div>
- <?php
- }
- ?>
- <?php if ( has_post_format( 'audio' , get_the_id())) {?>
- <div class="blogpostcategory">
- <div class="audioPlayerWrap">
- <div class="loading"></div>
- <div class="audioPlayer">
- <?php
- if(isset($postmeta["audio_post_url"][0]))
- echo do_shortcode('[audio file="'. esc_url($postmeta["audio_post_url"][0]) .'"]') ?>
- </div>
- </div>
- <?php get_template_part('includes/boxes/loopBlog'); ?>
- </div>
- <?php
- }
- ?>
- <?php
- if ( !get_post_format() ) {?>
- <div class="blogpostcategory">
- <?php if(pmc_getImage(get_the_id(), 'blog') != '') { ?>
- <a class="overdefultlink" href="<?php the_permalink() ?>">
- <div class="overdefult">
- </div>
- </a>
- <div class="blogimage">
- <div class="loading"></div>
- <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php echo pmc_getImage(get_the_id(), 'blog'); ?></a>
- </div>
- <div class="bottomborder"></div>
- <?php } ?>
- <?php get_template_part('includes/boxes/loopBlog'); ?>
- </div>
- <?php } ?>
- <?php if(is_sticky()) { ?>
- </div>
- <?php } ?>
- <div class="blog_social"> <?php pmc_socialLinkSingle(get_the_permalink(),get_the_title()) ?></div>
- <?php endwhile; wp_reset_query(); ?>
- <div id="rollll"><?php putRevSlider("slider-patrocinio-topo","homepage") ?></div>
- <?php
- $page = (get_query_var('page')) ? get_query_var('page') : 1;
- $args = array (
- 'post_type' => array( 'gastronomia', 'entretenimento', 'lifestyle' ),
- 'posts_per_page' => 10,
- 'paged' => $page
- );
- $my_query = new WP_Query ($args);
- $GLOBALS['wp_query']->max_num_pages = $my_query->max_num_pages;
- ?>
- <?php $i = 0; ?>
- <?php while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
- <?php $i++; ?>
- <div class="estepost">
- <?php if(is_sticky(get_the_id())) { ?>
- <div class="pmc_sticky">
- <?php } ?>
- <?php
- $postmeta = get_post_custom(get_the_id()); ?>
- <div class="blog_category"><?php echo '<em>' . get_the_category_list( __( ', ', 'pmc-themes' ) ) . '</em>'; ?></div>
- <h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
- <?php
- if ( has_post_format( 'gallery' , get_the_id())) {
- ?>
- <div class="slider-category">
- <div class="blogpostcategory">
- <?php
- global $post;
- $attachments = '';
- $post_subtitrare = get_post( get_the_id() );
- $content = $post_subtitrare->post_content;
- $pattern = get_shortcode_regex();
- preg_match( "/$pattern/s", $content, $match );
- if( isset( $match[2] ) && ( "gallery" == $match[2] ) ) {
- $atts = shortcode_parse_atts( $match[3] );
- $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' );
- }
- if ($attachments) {?>
- <div id="slider-category" class="slider-category">
- <div class="loading"></div>
- <ul id="slider" class="bxslider">
- <?php
- foreach ($attachments as $attachment) {
- $image = wp_get_attachment_image_src( $attachment, 'blog' ); ?>
- <li>
- <img src="<?php echo $image[0] ?>"/>
- </li>
- <?php } ?>
- </ul>
- </div>
- <?php } ?>
- <div class="bottomborder"></div>
- <?php get_template_part('includes/boxes/loopBlog'); ?>
- </div>
- </div>
- <?php }
- if ( has_post_format( 'video' , get_the_id())) { ?>
- <div class="slider-category">
- <div class="blogpostcategory">
- <?php
- if(!empty($postmeta["video_post_url"][0])) {?>
- <?php
- $video_arg = '';
- $video = wp_oembed_get( esc_url($postmeta["video_post_url"][0]), $video_arg );
- $video = preg_replace('/width=\"(\d)*\"/', 'width="800"', $video);
- $video = preg_replace('/height=\"(\d)*\"/', 'height="490"', $video);
- echo $video;
- }
- else{
- $image = 'http://placehold.it/800x490';
- ?>
- <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php echo pmc_getImage(get_the_id(),'blog'); ?></a>
- <?php } ?>
- <div class="bottomborder"></div>
- <?php get_template_part('includes/boxes/loopBlog'); ?>
- </div>
- </div>
- <?php }
- if ( has_post_format( 'link' , get_the_id())) {?>
- <div class="link-category">
- <div class="blogpostcategory">
- <?php get_template_part('includes/boxes/loopBlogLink'); ?>
- </div>
- </div>
- <?php
- }
- ?>
- <?php if ( has_post_format( 'audio' , get_the_id())) {?>
- <div class="blogpostcategory">
- <div class="audioPlayerWrap">
- <div class="loading"></div>
- <div class="audioPlayer">
- <?php
- if(isset($postmeta["audio_post_url"][0]))
- echo do_shortcode('[audio file="'. esc_url($postmeta["audio_post_url"][0]) .'"]') ?>
- </div>
- </div>
- <?php get_template_part('includes/boxes/loopBlog'); ?>
- </div>
- <?php
- }
- ?>
- <?php
- if ( !get_post_format() ) {?>
- <div class="blogpostcategory">
- <?php if(pmc_getImage(get_the_id(), 'blog') != '') { ?>
- <a class="overdefultlink" href="<?php the_permalink() ?>">
- <div class="overdefult">
- </div>
- </a>
- <div class="blogimage">
- <div class="loading"></div>
- <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php echo pmc_getImage(get_the_id(), 'blog'); ?></a>
- </div>
- <div class="bottomborder"></div>
- <?php } ?>
- <?php get_template_part('includes/boxes/loopBlog'); ?>
- </div>
- <?php }
- ?>
- <?php if(is_sticky()) { ?>
- </div>
- <?php } ?>
- <div class="blog_social"> <?php pmc_socialLinkSingle(get_the_permalink(),get_the_title()) ?></div>
- <?php if($i == 4)
- {
- ?>
- <div class="spacer">
- <?php echo putRevSlider("slider-patrocinio-rodape","homepage"); ?>
- </div>
- <?php
- }
- ?>
- </div>
- <?php endwhile; ?>
- <?php else : ?>
- <div class="postcontent">
- <h1><?php echo $pmc_data['errorpagetitle'] ?></h1>
- <div class="posttext">
- <?php echo $pmc_data['errorpage'] ?>
- </div>
- </div>
- <?php endif; ?>
- </div>
- <div class="spacer">
- <?php
- putRevSlider("slider-rodape-posts-inicio","homepage")
- ?>
- </div>
- <!-- sidebar -->
- <?php if(!isset($pmc_data['use_fullwidth'])) { ?>
- <div class="sidebar">
- <?php dynamic_sidebar( 'sidebar' ); ?>
- </div>
- <?php } ?>
- <?php if ( function_exists( 'wp_pagination' ) )
- wp_pagination($my_query);
- ?>
- </div>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment