PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Filtering problem on the website

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hello

Filtering on a page other than archive does not work for me. I have the CPT"wizytowki" I want to display them on the home page I am building in SiteOrigin. I add a post-loop widget I select the loop-wizytowki template. I add filtering via a shortcode.

Can you help me?

Thanks

Hello

What plugin version number are you  using?

Please   drop me  exact  link to the issue

Hello

I using 1.3.1 version

This is link: https://cyberjob.pl/cyberjob-strona-glowna/

And code of loop-wizytowki.php template

Spoiler

<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$args = array(
    'post_type'      => 'wizytowki',
    'posts_per_page' => 5,
    'paged'          => $paged
);
$query = new WP_Query( $args );
if(class_exists('MetaDataFilter') AND MetaDataFilter::is_page_mdf_data()){
   $_REQUEST['mdf_do_not_render_shortcode_tpl'] = true;
   $_REQUEST['mdf_get_query_args_only'] = true;
   do_shortcode('[meta_data_filter_results]');
   $args = $_REQUEST['meta_data_filter_args'];
   global $wp_query;
   $wp_query=new WP_Query($args);
   $_REQUEST['meta_data_filter_found_posts']=$wp_query->found_posts;
}
if ( $wp_query->have_posts() ) {
    while ( $wp_query->have_posts() ) {
        $wp_query->the_post();
        the_title();
echo"<br>";
    }
    // Wyświetlanie paginacji
    $total_pages = $wp_query->max_num_pages;
    if ( $total_pages > 1 ) {
        $current_page = max( 1, get_query_var( 'paged' ) );
        echo '<div class="pagination">';
        echo paginate_links( array(
            'base'      => get_pagenum_link( 1 ) . '%_%',
            'format'    => '/page/%#%',
            'current'   => $current_page,
            'total'     => $total_pages,
            'prev_text' => '« Poprzednia',
            'next_text' => 'Następna »',
        ) );
        echo '</div>';
    }
}
wp_reset_postdata();
?>

Drop  me  screenshots of  MDTF  shortcode(263)  settings

And as I see this custom template should not work

Sure

I use:

https://prnt.sc/h8SHxmE7dDrq

https://prnt.sc/ZLj1dO9LQdtn

https://prnt.sc/w8fhfkkExgMr

 

Why this template will not work?

Hello

Try  to  use  these  options - https://share.pluginus.net/image/i20230614105124.png

https://share.pluginus.net/image/i20230614104421.png - the first part of the code doesn't make sense because $query is not used in the template

In the loop you use $wp_query which doesn't exist until there is no search

Hello
I did it a little differently. I created a SiteOrigin widget and pasted the code and it works. It filters nicely. But I wanted to do AJAX filtering so that it doesn't jump to the top of the page. But it doesn't work. What am I doing wrong?

hello

Ajax  filtering  works  only with  this  shortcode - https://wp-filter.com/features/shortcode-mdf_results_by_ajax/

Please  watch  this  video  - https://wp-filter.com/video-tutorials#video_1294