Press-This stopped redirecting to permalink after post publish

Okay, so after narrowing the problem down to the function get_post_permalink() which gets called by wp-admin/includes/class-wp-press-this.php on Line 181, and for some reason returns the Querystring rather than the Permalink when I am using my 3rd party theme, I implemented a workaround which is not ideal, but it works! I added the following code, starting … Read more

How do I make 301 redirection from `/%post_id%/` to `/%postname%/`?

I’ve written my own solution, sharing it and hoping it will help someone. Add this to your functions.php: <?php add_action(‘parse_request’, ‘redirect_postid_to_postname’); function redirect_postid_to_postname($wp) { // If /%post_id%/ if (is_numeric($wp->request)) { $post_id = $wp->request; $slug = get_post_field( ‘post_name’, $post_id ); // If the post slug === the post number, prevent redirection loops. if ($slug !== $post_id) … Read more

Custom permalinks in WordPress

hi here is the solution if you are asking about custom url. go to pages and edit page ( note that download classic editor first) you can easily create a custom permalink with a classic editor. once you download a classic editor in your WordPress then it is so easy to create custom url for … Read more

Permalink in WordPress loop outputs for each new line

This is happening because the_category() outputs a list of categories, with links. So it’s outputting its own <a> tags, and you cannot put <a> tags inside other <a> tags. It’s not valid HTML. What you’re seeing is the browser’s attempt to produce valid HTML based on invalid markup. HTML is very resilient, and invalid markup … Read more

How to rename ‘Tag Base’ with WPeC 3.8?

Tags are a custom taxonomy called product_tag in WPEC 3.8+, they’re not the same taxonomy as default WordPress tags so that’s why tagbase has no effect. Line 315 in wpsc-core/wpsc-functions.php: register_taxonomy( ‘product_tag’, ‘wpsc-product’, array( ‘hierarchical’ => false, ‘labels’ => $labels, ‘rewrite’ => array( ‘slug’ => “https://wordpress.stackexchange.com/” . sanitize_title_with_dashes( _x( ‘tagged’, ‘slug, part of url’, ‘wpsc’ … Read more