Hot answers tagged

5

I am not sure if this is the best solution or not, but it works: function movie_review_permalink( $url, $post, $leavename ) { $category = get_the_category($post->ID); if ( !empty($category) && $category[0]->slug == "test" ) { //change 'test' to your category slug $date=date_create($post->post_date); $my_date = ...


5

I want ot give you an "alternate" approach. I'm pretty sure you're not going to follow this, but I thinks is interesting to read. OOP "routing" approach In WordPress, "pretty" urls are mathed to "ugly" urls. But most web frameworks (not only PHP) uses the concept of "routing": to match an url to an "action" (or a controller). I want to give you an idea ...


2

Hm. Have you thought about doing some URL rewrites in .htaccess? RewriteRule ^category/bar-talk/page/([0-9]+)$ /bar-talk/drink-number/$1 [L,R=301] RewriteRule ^bar-talk/drink-number/([0-9]+)$ /index.php?category_name=bar-talk&page=$1 [L] // @drizzlyowl


1

i'd the same problem as you. My fix was that one, but for my case i'm using Visual Composer in page creation. That's important 'cause my method will port only the content part of the page. Instead of changing the priority, i changed the category template for that category! So.. create the page that you want to set as the category and take note of the ID ...


1

You could force the redirect this way by checking for the get_var query value: add_action('init','my_redirect_check'); function my_redirect_check() { if (isset($_GET['my_var'])) { if ($_GET['my_var'] != '') { if ($_SERVER["HTTPS"]) {$location = 'https://';} else {$location = 'http://';} $location .= ...


1

For anyone interested, this was the full solution to my problem. So far it works quite good. I use %postname% as the permalink structure and have my Custom Taxonomy working as my Brand and the Custom Post Type working as my Product. So my URL looks like this example.org/some-brand/some-product while I can display an overview on example.org/some-brand/. ...



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