Tag Info

Hot answers tagged

3

I use template_redirect hook for this purpose. I suppose rented in your question is not taxonomy itself, but one term of some taxonomy. function my_page_template_redirect() { if( is_singular( 'rentals' ) && has_term('rented', 'your taxonomy name') ) { wp_redirect( home_url(), 301 ); exit(); } } add_action( ...


1

I was able to solve this by defining a rewrite rule: function rewrite_rules($rules) { $newRules = array(); $newRules['states/(.+)/(.+?)$'] = 'index.php?district=$matches[2]'; return array_merge($newRules, $rules); } add_filter('rewrite_rules_array', __NAMESPACE__ . '\\rewrite_rules');


1

In this situation I would use the page as a placeholder to configure the sidebars, even though WordPress will completely ignore it on the front end. Just add the page, make sure the slug is trainings, let the client set it up as they need, and then in your template: if ( $trainings_page = get_page_by_path( 'trainings' ) ) { $acf_sidebars_data = ...


1

I just stumbled across this question and thought I'd share my most common solution which may not work for everyone in all scenarios but I believe this is the most efficient way to achieve the desired results. When you register a CPT that does not require a single-view output in your theme or plugin, simply define the property 'public' => false, For ...


1

There's an array option when creating a custom post type and custom taxonomy for ""rewrite"" and you can set a ""slug"" and it's there that you can change your permalink structure. For more read here. Also the other option that I get from post 1 and post 2 one helped me blink some idea. 1 Rewrite rule: You need to add a new rewrite rule so Wordpress knows ...


1

You could use this search and replace tool: search and replace by interconnectit Apart from that you could put some redirects in your htaccess, but really the search and replace works great.



Only top voted, non community-wiki answers of a minimum length are eligible