Taking a value from PHP_URL_PATH won’t work after WordPress 5.5 update
Taking a value from PHP_URL_PATH won’t work after WordPress 5.5 update
Taking a value from PHP_URL_PATH won’t work after WordPress 5.5 update
Actually, you can always just use a query parameter, even if you have the “pretty” permalinks enabled. So instead of /category/sub-category/article.html/attachment/image you can go to /?attachment=image. The only case when this “breaks down” is when you go to /category/sub-category/article.html?attachment=image, because WordPress gets confused: it tries to query for a post and an attachment at the … Read more
Not completely sure I understand what you mean with that the parameters fall under a page job, but if you mean that different contents are loaded on the same page using javascript / ajax, you could use https://github.com/browserstate/history.js/ to generate the corresponding url for each state. Difficult to say more about how you could implement … Read more
Two possibilities: Use the the_content-filter, or just call it in your template. You can just throw the plugin in your folder, or add one (or both) function(s) in your themes functions.php file. The filter triggers only for the post format link, while the template tag can be used more universal – in the loop. As … Read more
What about something like that? function wpse139657_orderby(){ if( isset($_GET[‘orderby’]) ){ $order = $_GET[‘order’] or ‘DESC’; set_query_var(‘orderby’, ‘meta_value_num’); set_query_var(‘meta_key’, $_GET[‘orderby’]); set_query_var(‘order’, $order); } } add_filter(‘pre_get_posts’,’wpse139657_orderby’); In this way you can call your urls with a ?orderby=rank suffixed and it should do the trick. You can also have an optional order parameter, should you want to implement … Read more
It’s better to share some of your code that already you used. And you mention first line that you have search page ? what exactly you mean by that ? WordPress have default search page did you mention that one ? if you are then try this code function change_search_url_rewrite() { if ( is_search() && … Read more
This happens in redirect_canonical(). You can disable that function with: remove_action(‘template_redirect’, ‘redirect_canonical’); But be aware it does a lot more. Too much for my taste … So there might be side effects.
here you go: add_action(‘init’, ‘wp_new_flush_rewrite_rules’); //Run this action only ONCE if not you are looking at 2 extra db queries on every page load so dont forget to comment it out function wp_new_flush_rewrite_rules() { global $wp_rewrite; $wp_rewrite->flush_rules(); } add_action(‘generate_rewrite_rules’, ‘new_rewrite_rules’); function new_rewrite_rules( $wp_rewrite ) { $post_type=”post”; $new_rules = array( ‘writer/(.+?)/page/?([0-9]{1,})/?$’ => ‘index.php?post_type=”.$post_type.”&meta_key=writer&meta_value=”.$wp_rewrite->preg_index(1).”&paged=’.$wp_rewrite->preg_index(2), ‘writer/(.+?)/?$’ => ‘index.php?post_type=”.$post_type.”&meta_key=writer&meta_value=”.$wp_rewrite->preg_index(1), … Read more
I was experiencing a similar problem and traced it back to Yoast’s WordPress SEO plugin. This is a very popular plugin, so I wanted to post my fix. If you are running this plugin, do the following: Navigate to SEO > Permalinks Is “Redirect ugly URL’s to clean permalinks” checked? If so, scroll down to … Read more
Change default URL of image attachment