Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permalink structure compitible #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions search-filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ public function set_defaults()

//grab search term for prefilling search input
if(isset($wp_query->query['s']))
{//!"$%^&*()
{//!"£$%^&*()
$this->searchterm = trim(get_search_query());
}

Expand Down Expand Up @@ -691,8 +691,14 @@ public function check_posts()

if(get_option('permalink_structure'))
{
//$catrel = trim(str_replace(home_url(), "", get_category_link()), "/").$categories."/"; //get full category link, remvoe the home url to get relative, trim traling slashed, the append slash at the end
$category_base = (get_option( 'category_base' )=="") ? "category" : get_option( 'category_base' );

$custom = str_replace("/%postname%/","",get_option('permalink_structure'));
$custom = ltrim($custom,'/');


//$catrel = trim(str_replace(home_url(), "", get_category_link()), "/").$categories."/"; //get full category link, remvoe the home url to get relative, trim traling slashed, the append slash at the end
$category_base = (get_option( 'category_base' )=="") ? $custom."/category" : get_option( 'category_base' );

$category_path = $category_base."/".$categories."/";
$this->urlparams .= $category_path;
}
Expand Down Expand Up @@ -1721,4 +1727,4 @@ function walk_taxonomy( $type = "checkbox", $args = array() ) {
require_once(SEARCHANDFILTER_PLUGIN_DIR."/of-admin.php");


?>
?>