How to display a public profile page for registered users with custom slug?

Every registered user can have profile, they don’t need to have posts. To change WordPress author’s profile permalink, paste the following code in your functions.php: function change_author_permalink_base() { global $wp_rewrite; $wp_rewrite->author_base = “user”; } add_filter( ‘init’, ‘change_author_permalink_base’ ); After pasting the code, visit Settings->Permalink Structure under your wordpress admin, to flush the rewrite rules. This … Read more

Removing the redirect after changing a page’s slug

This (in your functions.php) will turn it off (but see also the comment I’ve left): remove_action(‘template_redirect’, ‘wp_old_slug_redirect’); It seems odd that your wp_postmeta table wouldn’t have any _wp_old_slug keys – the bit of code that does that is in wp-includes/query.php (wp_old_slug_redirect()) – you could add an exit or debug statement there to check if it’s … Read more

Using $_GET variables in the URL?

Try adding the variable to the WordPress’ array of ‘recognised query variables’… add_filter(‘query_vars’, ‘my_register_query_vars’ ); function my_register_query_vars( $qvars ){ //Add query variable to $qvars array $qvars[] = ‘my_error’; return $qvars; } Then the value of ‘my_error’ can be found via get_query_var(‘my_error’). (See Codex) EDIT From Otto’s comment, it’s better to do: add_action(‘init’,’add_my_error’); function add_my_error() { … Read more

Removing Parent Page(s) from Permalink

a quick search shows another stackexchange topic on this, and it used this code to cleanup the permalink of parents/ancestors: function wpse_101072_flatten_hierarchies( $post_link, $post ) { if ( ‘page’ != $post->post_type ) return $post_link; $uri = ”; foreach ( $post->ancestors as $parent ) { $uri = get_post( $parent )->post_name . “https://wordpress.stackexchange.com/” . $uri; } return … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)