Remove words from permalink when saving post automatically?

To update the slug of posts when they’re published, hook to save_post action as in this answer. Also use sanitize_title() to perform the needed sensitization: add_action( ‘save_post’, ‘wpse325979_save_post_callback’, 10, 2 ); function wpse325979_save_post_callback( $post_id, $post ) { // verify post is not a revision if ( ! wp_is_post_revision( $post_id ) ) { // unhook this … Read more

shortcode to output multiple images urls from media library id

Try this function image_thingy($atts) { // Merge attribtes from shortcode with defaults extract(shortcode_atts(array( ‘id’ => 1, ), $atts)); // Extract id’s from shortcode attributes and convert into an array $ids = explode(‘,’,$atts[‘id’]); $output=””; // Variable that holds the shortcode output, at the end this will be returned // Loop through ids and fetch urls, and … Read more

Remove the Parent category from the permalink but leave the child category

I think, there are two things to be resolved: 1) You need that posts (and other post types) also followed that command, so use both: add_filter( ‘post_link’, ‘remove_parent_category’, 10, 3 ); add_filter( ‘post_type_link’, ‘remove_parent_category’, 10, 3 ); 2) but then categories also need to have changed url, so use: add_filter( ‘category_link’, ‘remove_parent_category_2’, 10, 2); function … Read more

Change URL structure of subcategory archive pages

You answered your own question yourself. You want links to custom categories to look like this {taxonomy_slug}/{parent_term}/{child_term}/{grandchild_term}/ so you should pay attention to two parameters in the register_taxonomy() arguments: hierarchical and rewrite. $args = [ ‘hierarchical’ => true, // <– term may have a parent ‘labels’ => $labels, ‘rewrite’ => [ // hierarchical urls, defaults … Read more

Permalinks Structure and 404 Question

It’s a bit of a trick to get a WordPress site working within a framework of a non-Wordpress (html only) site in a fully-integrated way (though it can be done!). To keep things simple, I’d keep them pretty separate for the moment, which it sounds like you’re happy to do. So I guess you have … Read more

Search result permalink

That kind of search request should already work(query it directly in your address bar), the component you’re missing is redirecting the non-pretty search requests.. For doing the redirect, you should find the following plugin still works.. http://txfx.net/wordpress-plugins/nice-search/ Hope that helps..