Forums › Forums › Search & Filter Pro › How do you display results at the archive page URL rather than ?_sft etc
- This topic has 5 replies, 2 voices, and was last updated 6 years, 11 months ago by Trevor.
-
Anonymous(Private) December 4, 2017 at 4:05 pm #145487
Hi there
Great plugin (only doing an early integration effort but it looks very promising so far).
I’m probably overlooking something basic but I can’t understand how to display my filter results at the same CPT archive as they’re initiated. For instance, I have a meta filter working at /my-section/archive/ (which is a CPT archive for a single post type, configured properly with has_archive etc). With other filtering plugins I can filter to /my-section/archive/genre/{genre-name}/ but with S&F the results always redirect to /my-section/archive/?_sft_genres={genre-name}
Is there an option to retain the URL structure that I want?
Any help much appreciated.
Ben
Anonymous(Private) December 4, 2017 at 5:13 pm #145508Hi Trevor.
Thanks for the swift response. That is what I have got set and hence why I thought it would do what I was describing!
Not sure if it helps, but here’s my CPT definition:
`
$labels = array(
“name” => __(‘Programmes’, ”),
“singular_name” => __(‘Programme’, ”),
);$args = array(
“label” => __(‘Programmes’, ”),
“labels” => $labels,
“description” => “”,
“public” => true,
“publicly_queryable” => true,
“show_ui” => true,
“show_in_rest” => false,
“rest_base” => “”,
“has_archive” => true,
“show_in_menu” => true,
“exclude_from_search” => false,
“capabilities” => array(
‘read_post’ => ‘read_programme’,
‘read_private_posts’ => ‘read_private_programmes’,
‘create_posts’ => ‘edit_programmes’,
‘edit_others_posts’ => ‘edit_others_programmes’,
‘edit_post’ => ‘edit_programme’,
‘edit_posts’ => ‘edit_programmes’,
‘edit_private_posts’ => ‘edit_private_programmes’,
‘edit_published_posts’ => ‘edit_published_programmes’,
‘publish_posts’ => ‘publish_programmes’,
‘delete_others_posts’ => ‘delete_others_programmes’,
‘delete_post’ => ‘delete_programme’,
‘delete_posts’ => ‘delete_programmes’,
‘delete_published_posts’ => ‘delete_published_programmes’,
‘delete_private_posts’ => ‘delete_private_programmes’
),
“map_meta_cap” => true,
“hierarchical” => false,
“rewrite” => array(“slug” => “my-section/archive”, “with_front” => true),
“query_var” => true,
“menu_icon” => “dashicons-video-alt3”,
“supports” => array(“title”, “thumbnail”, “excerpt”, “author”)
);register_post_type(“programme”, $args);
`
and here’s the taxonomy I’m trying to filter on…
`
$labels = array(
“name” => __(‘Genres’, ”),
“singular_name” => __(‘Genre’, ”),
“add_new_item” => __(‘Add Genre’, ”),
“new_item_name” => __(‘Add Genre’, ”),
“edit_item” => __(‘Edit Genre’, ”),
“view_item” => __(‘View Genre’, ”),
“update_item” => __(‘Update Genre’, ”),
“parent_item” => __(‘Parent Genre’, ”)
);
$args = array(
“label” => __(‘Genres’, ”),
“labels” => $labels,
“public” => true,
“hierarchical” => false,
“label” => “Genres”,
“show_ui” => true,
“show_in_menu” => true,
“show_in_nav_menus” => true,
“capabilities” => array(
‘manage_terms’ => ‘manage_genres’,
‘edit_terms’ => ‘edit_genres’,
‘delete_terms’ => ‘delete_genres’,
‘assign_terms’ => ‘assign_genres’
),
“query_var” => ‘genres’,
“rewrite” => array(‘slug’ => ‘genres’, ‘with_front’ => false,),
“show_admin_column” => true,
“show_in_rest” => false,
“rest_base” => “”,
“show_in_quick_edit” => true,
);
register_taxonomy(“genres”, array(“programme”, “show”), $args);
`
In posting this, I’ve just spotted that I’ve got ‘with_front’ => false, which I didn’t think would affect anything but I’ll try it with true.
Any other scenarios in which this problem sometimes occurs?
Cheers.
Ben
Trevor(Private) December 4, 2017 at 5:18 pm #145512It should work, AFAIK. You have a CPT called programmes and a taxonomy on it called genres. I see no reason why it should not work.
What elements do you have in the form? Do you have the same taxonomy in the form, and also have auto detect for taxonomies ON?
Anonymous(Private) December 4, 2017 at 5:25 pm #145522I’ve trimmed it back to as simple/minimal as possible just to try and debug this aspect:
General: Programmes CPT, Auto-submit, CPTs & Taxonomies auto-detect (everything else default).
Display results: Post Type Archive, AJAX all off (everything else default)
Taxonomy: Just that one – Genres
Tags/Tax/Cats: default
Post Meta: default
Advanced: defaultI’m heartened to know that at least it is possible. Probably something affecting it externally somewhere. I’ll carry on digging. 🙂
-
AuthorPosts