Adicionar Filtro Ajax onde há Paginação Ajax
ERRATA: Adicionar filtro isotope onde há paginação ajax.
Boa tarde pessoal, comprei um tema no themeforest, porém ele é todo feito utilizando os templates do wordpress. Já praticamente finalizei o site, porém eu gostaria de exibir na home, uma função que há em outra página, que é o filtro isotope.
Veja, como o filtro já funciona na página: http://integrae.net.br/imoveis/
Porém, gostaria de adicionar esse filtro, exibindo os imóveis da mesma forma que já é exibido na home: http://integrae.net.br/ (seção IMÓVEIS EM DESTAQUE).
Veja abaixo, como é o template da página "IMÓVEIS":
<?php
get_header();
?>
<!-- Page Head -->
<?php get_template_part("banners/gallery_page_banner"); ?>
<!-- Content -->
<div class="container contents listing-grid-layout">
<div class="row">
<div class="span12 main-wrap">
<!-- Main Content -->
<div class="main">
<section class="listing-layout">
<?php
$title_display = get_post_meta( $post->ID, 'REAL_HOMES_page_title_display', true );
if( $title_display != 'hide' ){
?>
<h3 class="title-heading"><?php the_title(); ?></h3>
<?php
}
?>
<!-- Gallery Filter -->
<div id="filter-by" class="clearfix">
<a href="#" data-filter="gallery-item" class="active"><?php _e('All', 'framework'); ?></a><?php
$status_terms = get_terms( array( 'taxonomy' => 'property-status' ) );
if ( !empty($status_terms) && is_array($status_terms) )
{
foreach ($status_terms as $status_term)
{
echo '<a href="' . get_term_link( $status_term->slug, $status_term->taxonomy ) . '" data-filter="'.$status_term->slug.'" title="' . sprintf(__('View all Properties having %s status', 'framework'), $status_term->name) . '">' . $status_term->name . '</a>';
}
}
?>
</div>
<!-- Gallery Container -->
<div id="gallery-container">
<div class="<?php global $gallery_name; echo esc_attr( $gallery_name ); ?> isotope clearfix">
<?php
// Basic Gallery Query
$query_args = array(
'post_type' => 'property',
'posts_per_page' => -1
);
// Gallery Query and Start of Loop
$gallery_query = new WP_Query( $query_args );
while ( $gallery_query->have_posts() ) :
$gallery_query->the_post();
// Getting list of property status terms
$term_list = '';
$terms = get_the_terms( $post->ID, 'property-status' );
if ( !empty($terms) && !is_wp_error( $terms ) ) :
foreach( $terms as $term )
{
$term_list .= $term->slug;
$term_list .= ' ';
}
endif;
if(has_post_thumbnail()):
?>
<div <?php post_class("gallery-item isotope-item $term_list"); ?> >
<?php
$image_id = get_post_thumbnail_id();
$full_image_url = wp_get_attachment_url($image_id);
global $gallery_image_size;
$featured_image = wp_get_attachment_image_src( $image_id, $gallery_image_size );
?>
<figure>
<div class="media_container">
<a class="<?php echo get_lightbox_plugin_class(); ?> zoom" <?php echo generate_gallery_attribute(); ?> href="<?php echo esc_url( $full_image_url ); ?>" title="<?php the_title(); ?>"></a>
<a class="link" href="<?php the_permalink(); ?>"></a>
</div>
<?php echo '<img class="img-border" src="'.$featured_image[0].'" alt="'.get_the_title().'">'; ?>
</figure>
<h5 class="item-title entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h5>
<time class="updated hide" datetime="<?php the_modified_time('c'); ?>"><?php the_modified_time('M d, Y'); ?></time>
<span class="vcard hide">
<?php
printf( '<a class="url fn" href="%1$s" title="%2$s" rel="author">%3$s</a>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'framework' ), get_the_author() ) ),
get_the_author()
);
?>
</span>
</div>
<?php
endif;
endwhile;
?>
</div>
</div>
<!-- end of gallery container -->
</section>
</div><!-- End Main Content -->
</div> <!-- End span12 -->
</div><!-- End contents row -->
</div><!-- End Content -->
<?php get_footer(); ?>
Veja abaixo, como é o template do conteúdo da página "HOME":
<?php
/**
* Template: Homepage Properties
*
* @since 2.6.3
*/
?>
<div class="container">
<div class="row">
<div class="span12">
<div class="main">
<section id="home-properties-section" class="property-items <?php if( 'true' == get_option('theme_ajax_pagination_home') ) { echo 'ajax-pagination'; } ?>">
<?php get_template_part( 'template-parts/home-slogan' ); // Homepage Slogan ?>
<div id="home-properties-section-wrapper">
<div id="home-properties-section-inner">
<div id="home-properties-wrapper">
<div id="home-properties" class="property-items-container clearfix">
<?php
/* List of Properties on Homepage */
$number_of_properties = intval( get_option('theme_properties_on_home') );
if(!$number_of_properties){
$number_of_properties = 4;
}
if ( is_front_page() ) {
$paged = (get_query_var('page')) ? get_query_var('page') : 1;
}
$home_args = array(
'post_type' => 'property',
'posts_per_page' => $number_of_properties,
'paged' => $paged
);
/* Modify home query arguments based on theme options - related filters resides in functions.php */
$home_args = apply_filters( 'real_homes_homepage_properties', $home_args );
/* Sort Properties Based on Theme Option Selection */
$sorty_by = get_option('theme_sorty_by');
if ( ! empty( $sorty_by ) ) {
if ( $sorty_by == 'low-to-high' ) {
$home_args[ 'orderby' ] = 'meta_value_num';
$home_args[ 'meta_key' ] = 'REAL_HOMES_property_price';
$home_args[ 'order' ] = 'ASC';
} elseif ( $sorty_by == 'high-to-low' ) {
$home_args[ 'orderby' ] = 'meta_value_num';
$home_args[ 'meta_key' ] = 'REAL_HOMES_property_price';
$home_args[ 'order' ] = 'DESC';
} elseif ( $sorty_by == 'random' ) {
$home_args[ 'orderby' ] = 'rand';
}
}
$home_properties_query = new WP_Query( $home_args );
/* Homepage Properties Loop */
if ( $home_properties_query->have_posts() ) :
$post_count = 0;
while ( $home_properties_query->have_posts() ) :
$home_properties_query->the_post();
/* Display Property for Home Page */
get_template_part('template-parts/property-for-home');
/* To output clearfix after every 2 properties */
$post_count++;
if( 0 == ( $post_count % 2 ) ){
echo '<div class="clearfix"></div>';
}
endwhile;
else:
?>
<div class="alert-wrapper">
<h4><?php _e('No Properties Found!', 'framework') ?></h4>
</div>
<?php
endif;
?>
</div><!-- end of #home-properties -->
</div><!-- end of #home-properties-wrapper -->
<div class="svg-loader">
<img src="<?php echo get_template_directory_uri(); ?>/images/loading-bars.svg" width="32" height="32">
</div>
<?php
if( 'true' == get_option('theme_ajax_pagination_home') ) {
theme_ajax_pagination( $home_properties_query->max_num_pages);
} else {
theme_pagination( $home_properties_query->max_num_pages);
}
?>
</div><!-- end of #home-properties-section-inner -->
</div><!-- end of #home-properties-section-wrapper -->
<?php wp_reset_query(); ?>
</section>
</div>
<!-- /.main -->
</div>
<!-- /.span12 -->
</div>
<!-- /.row -->
</div>
<!-- /.container -->
Alguém poderia me ajudar nisso?
Discussão (0)
Carregando comentários...