Duplicate slug/permalink issue

You can do that using Custom Permalinks Plugin, you need to add a full slug manually [shows/2017/any]. It also allow you customize your permalink: [anyname/another/2017/example/slug]. You should still using this plugin, if you deactivate it, all permalinks will return to default [shows/2017/%postname%]

How to properly refresh page after form action?

Searching around and not being able to implement the action through init hook I’ve found this workaround which for sure isn’t the best but does the job nicely. echo “<script type=”text/javascript”> window.location=document.location.href; </script>”; at the end of $_POST instructions. If somebody has a better solution, welcome to share.

Custom Post Type Advanced Slug

This is pretty straightforward using a rewrite endpoint. The first step is to set an ep_mask when you register your taxonomy, which is part of the rewrite argument. Note that it’s a constant, and should be as-is, without quotes: $args = array( ‘rewrite’ => array( ‘slug’ => ‘location’, ‘with_front’ => false, ‘ep_mask’ => EP_TAGS ), …

Read more

Disable plugin If slug contains specific word

I found this alternative: $url = $_SERVER[“REQUEST_URI”]; $isItSlide = strpos($url, ‘revslider’); $isItBlog = strpos($url, ‘post.php’); if ($isItSlide!==false) { deactivate_plugins( ‘/resize-image-after-upload/resize-image-after-upload.php’ ); } if ($isItBlog!==false) { activate_plugins( ‘/resize-image-after-upload/resize-image-after-upload.php’ ); }

add_rewrite_rule on default post type

This would be bad practice, since WordPress already has a functionality to do this built in. Rewriting the built in functionality is never a good idea. To achieve this the best way is to use Taxonomies. Lets say you create two categories: Foo Bar Now select the categories for the post in question and setup …

Read more