Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?

ok – so this isn’t what I wanted but it does the trick. Adding a function to redirect when the user hits any term but one: function my_page_template_redirect() { if( is_singular( ‘custom-post-type’ ) && !(has_term(‘term’, ‘custom-taxonomy’)) ) { wp_redirect( home_url(), 301 ); exit(); } } add_action( ‘template_redirect’, ‘my_page_template_redirect’ ); Answer based on this one: Disable … Read more

Permalink Short code showing unnecessary link text inside the loop

ob_get_flush doesn’t do what you think it does. You’re assuming that it only ends the output buffer and returns its contents, which is incorrect, it also flushes the output buffer to the browser. So this: return ob_get_flush(); Is the same as this: $content = ob_get_clean(); echo $content; return $content; Use ob_get_clean(); instead, which erases the … Read more

Add variables from rewrite rules to query var

I wasn’t linking to the page correctly in the rewrite rules. The use of pagename was incorrect instead I should have used page_id. The rewrite rules I ended up using was add_rewrite_rule(‘^resa/start/?$’, ‘index.php?page_id=1897&route_page=start’, ‘top’); add_rewrite_rule(‘^resa/planera/?$’, ‘index.php?page_id=1897&route_page=plan’, ‘top’); add_rewrite_rule(‘^resa/dela/([^/]+)/?$’,’index.php?page_id=1897&route_page=share&share_id=$matches[1]’, ‘top’);