How to show in search results posts with a particular tag in a particular category?

Given the way categories & tags are setup in WordPress this would not work from a logical standpoint. The issue here is that tags have no way to be connected directly to a category, they are mutually exclusive from each other. The subcategories would work because a subcategory is directly related to is parent category … Read more

Pagination problem

The function redirect_canonical() is ‘responsible’ for your problem. Your default WordPress pagination (with core functions) is not gonna work if you do this, but you can filter out the pagination for your particular custom url: add_filter( ‘redirect_canonical’, ‘wp230913_canonical’, 10, 2 ); function wp230913_canonical( $redirect_url, $requested_url ) { if ( preg_match( “#foo/bar/[0-9]+/page/[0-9]+#”, $redirect_url ) ) { … Read more

Get the category is not working on url

I solved this problem using wp_get_object_terms, probably not the cleanest way but it does what I wanted. For those of you having the same problem, this is how my final product looks: function custom_permalink( $post_link, $id = 0, $leavename ) { global $wp_rewrite; $post = &get_post( $id ); if ( is_wp_error( $post ) || $post->post_type … Read more