Append a parametter at first or last to a certain URL

I got my code working now. Here is the below code that append that extra parameter to the end of the URL specified above. add_action(‘init’, ‘add_custom_query_for_search’); function add_custom_query_for_search(){ global $wp; $tempUrl = home_url() . add_query_arg( $wp->query_vars ) . ‘&propertyType=RNT’; if( ! isset($_GET[‘propertyType’]) && (strpos($tempUrl, ‘homes-for-sale-search’) !== false) ){ wp_redirect($tempUrl); die; } }

url not using query string no longer working

So I never found out why this broke in the first place, but I did find a solution that forces the proper url to work add_action( ‘init’, ‘add_mypage_rule’ ); function add_mypage_rule(){ add_rewrite_rule(‘^item/([^/]*)/?’,’index.php?pagename=item’,’top’); } Sussed out from here: https://stackoverflow.com/questions/18713230/wordpress-url-rewriting-parameters-in-url

remove SLASH on single_post but KEEP on categories and parent pages

After SO MANY research, I found a Great Simple solution via https://stackoverflow.com/a/54251892/10403689 (vote this ⬆UP⬆) Your Permalink Structure should be: /%category%/%postname%/ function no_post_slash( $string, $type ){ if($type == ‘single’) $string = untrailingslashit($string); return $string; } add_filter(‘user_trailingslashit’, ‘no_post_slash’, 70, 2); BUT this is only working on single_post not pages