Ugly permalinks stopped redirecting to pretty URLs

Found the following in a plugin file using grep -Ri ‘redirect_canonical’ /path/to/wordpress/plugins: remove_filter(‘template_redirect’, ‘redirect_canonical’); That disables WordPress’ built-in canonical URL redirects. Disabling the component of the plugin that contained that line fixed the problem. Beware the WordPress Mobile Pack’s Mobile Switcher. Hopefully reaching out to the plugin developer will result in a fix that allows … Read more

custom data in url

You can use the details here in this answer to solve your problem : Pretty URL with add_query_var Something along the lines of add_rewrite_endpoint(‘item’, array(EP_PAGES)); resulting in a rewrite rule that would let you use /prof/vac/item/1234 which you would then check in the vac pages template for a query variable ‘item’ and pull its value … Read more

Custom post type permalink structure

function myrules(){ add_rewrite_rule(‘^yourcptslughere/([^/]*)/([^/]*)/([^/]*)/?’,’index.php?p=$matches[1]&taxonomy=$matches[2]&name=$matches[3]’,’top’); } add_action(‘init’,’myrules’); Replace the ‘yourcptslughere‘ with what you wanted, and then add that to functions.php then flush your rewrite rules, and the final example you posted should work. I doubt it will be what the_permalink() returns however so you will have to construct the urls yourself, however they should be viewable at … Read more

Search results highlight breaks my read more link

Try this. function search_excerpt_highlight() { $excerpt = get_the_excerpt(); $keys = implode(‘|’, explode(‘ ‘, get_search_query())); $excerpt = preg_replace(‘/(‘ . $keys .’)/iu’, ‘<ins class=”search-highlight”>\0</ins>’, $excerpt); echo ‘<p>’ . $excerpt . ‘&hellip;’ . supralegal_read_more_link() . ‘</p>’; } function supralegal_auto_excerpt_more( $more ) { return ”; } add_filter( ‘excerpt_more’, ‘supralegal_auto_excerpt_more’ ); function supralegal_read_more_link() { return ‘ <a href=”‘. esc_url( get_permalink() … Read more