Tag Info

Hot answers tagged

3

The redirect is thanks to redirect_canonical() - we can simply swoop in with a filter and disable it for the front page: function wpse_184163_disable_canonical_front_page( $redirect ) { if ( is_page() && $front_page = get_option( 'page_on_front' ) ) { if ( is_page( $front_page ) ) $redirect = false; } return ...


2

I used the WooCommerce API and this code: <?php set_time_limit(0); // Include the client library require_once 'class-wc-api-client.php'; $consumer_key = 'XXXX'; // Add your own Consumer Key here $consumer_secret = 'XXXX'; // Add your own Consumer Secret here $store_url = 'http://www.example.com/'; // Add the home URL to the ...


2

This (in your functions.php) will turn it off (but see also the comment I've left): remove_action('template_redirect', 'wp_old_slug_redirect');


1

What I ended up doing was setting up an endpoint for food, like so: global $wp_rewrite; $wp_rewrite->add_endpoint( 'food', EP_PERMALINK | EP_PAGES ); $wp_rewrite->flush_rules(); function printview_query_vars($vars) { array_push($vars, 'food'); return $vars; } add_filter('query_vars','printview_query_vars'); Then I'd get a url like ...


1

If there is no clear evidence of any present redirect from the following sources: The htaccess, both under the public_html and under the public_html/folder (where folder is the directory having all the wp files), removing and regenerating them by mean of updating the permalinks, The .htaccess files were at some point deleted, and regenerated, The domain ...


1

a multi site approach wouldn't work since you will be creating multiple blogs, each will work as an individual WP installation, so each of them will hold multiple posts, pages, categories, etc that are not shared between blogs. The url you are proposing can't be defined using wordpress routing, so a custom code will need to be developed for this approach.


1

The publish_{post-type} action is triggered only when the post change from any post status (not published) to published; for example, if the post is already published and you edit it, the publish_{post-type} action is not triggered. I think you need to hook your function to save_post_{post_type} action, which is triggered every time a post is saved, not ...



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