New answers tagged

1

I was able to solve a similar issue using the wp command line tool. I had to use the command line tool because I was unable to login to Wordpress admin with my browser. wp @mysitestage config set WP_HOME "https://stage.mysite.com/" wp @mysitestage config set WP_SITEURL "https://stage.mysite.com/blogdir"


0

ob_get_flush doesn't do what you think it does. You're assuming that it only ends the output buffer and returns its contents, which is incorrect, it also flushes the output buffer to the browser. So this: return ob_get_flush(); Is the same as this: $content = ob_get_clean(); echo $content; return $content; Use ob_get_clean(); instead, which erases the ...


3

For this to work, you would have to add a rewrite that rewrites https://example.com/[manufacturer slug]/[brand slug] to index.php with e.g. manufacturer=[manufacturer slug]&brand=[brand slug]. e.g.: add_filter( 'rewrite_rules_array','jf_insert_rewrite_rules' ); function jf_insert_rewrite_rules( $rules ) { $newrules['^(.*)/(.*)/?$'] = 'index.php?...


0

@Paul G. you're right, switched to another theme showed the right link for editing user. My bad though, I missed functions.php from child theme where its modified add_filter('get_edit_user_link', ...


0

Please add this code in functions.php to remove the "category" text from permalink. function remove_category( $string, $type ) { if ( $type != 'single' && $type == 'category' && ( strpos( $string, 'category' ) !== false ) ){ $url_without_category = str_replace( "/category/", "/", $string ); ...


1

The solutions here are all good but were not consistent with both local and remote server environments. So I came up with a simpler neat solution that works better regardless of the WordPress permalink settings. function getCurrentUrl() { $protocol = is_ssl() ? 'https://' : 'http://'; return ($protocol) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'...


2

Background Even after looking around everywhere, I couldn't find a proper solution for removing CPT slug from permalinks that actually works and is consistent with how WordPress actually parses requests. As it seems, everyone else looking for the same solution is in the same boat as me. As it turns out, this is actually a two-part solution. Remove CPT slug ...


Top 50 recent answers are included