• Hi,

    Great plugin! I dont think its possible but wanted to ask it to be sure.
    Im not using my archive.php file but created new page template to show all my custom post types.

    I’d like to have a filter menu on this page and make sure that after filtering the user doesnt get redirected. Really hope this is possible and if not, do you have other solution?

    Kind regards,

    Mike

    https://www.ads-software.com/plugins/beautiful-taxonomy-filters/

Viewing 1 replies (of 1 total)
  • Plugin Author Jonathandejong

    (@jonathandejong)

    Hi Mike,

    Unfortunately it’s not possible since the plugin has to use WordPress core filtering possibilities. But may I ask why you need to use a page template instead?

    If it’s so that you can have more static page-like content on there as well may I suggest that you use the archive.php and simply query the page which contains all that content and output it on archive.php.

    To query a page based on it’s page template you can do this:

    $args = array(
    		'post_type' => 'page',
    		'meta_key' => '_wp_page_template',
    		'meta_value' => $template,
    		'posts_per_page' => 1
    	);
    	$the_query = new WP_Query( $args );

    or as a function to put in your functions.php file which returns the pages ID that you can use in for example get_the_title($postID)

    function get_page_by_template($template) {
    	$template = $template.'.php';
    	$args = array(
    		'post_type' => 'page',
    		'meta_key' => '_wp_page_template',
    		'meta_value' => $template,
    		'posts_per_page' => 1
    	);
    	$the_query = new WP_Query( $args );
    	// The Loop
    	while ( $the_query->have_posts() ) : $the_query->the_post();
    		$theID = get_the_ID();
    		wp_reset_postdata();
    		return $theID;
    	endwhile;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Filter on other pages’ is closed to new replies.