Remove category link

Hook ‘template_redirect’ action hook and redirect if in category using wp_redirect add_action(‘template_redirect’, ‘no_cat_archives’); function no_cat_archives() { if ( is_category() ) { wp_redirect( home_url(), 301 ); exit(); } }

Copy post taxonomy?

Yes, you don’t need a custom taxonomy, but a custom post type for courses, and probably a custom taxonomy for courses categories. In WordPress post types are containers for a certain type of information: every information type is a post type. E.g. Posts are a type and Pages are another type. Every post type (container) … Read more

Search form options group categories

You can use in search query wp public query vars. When searching in multiple categories, wordpress accepts comma separated category ids in url &cat=1,2,5 Now I can come up with only such simple solution. Get rid of wp_dropdown_categories use e.g. get_categories, so you can customize SELECT attribute name into cat[] (which is also possible with … Read more

How can I check which archive has referred the single? [closed]

Either use http referer or pass own param with your urls determining referring category. The first option seems better to me. The //check, whether a user does not access a page directly if(isset($_SERVER[‘HTTP_REFERER’])) { //get category object $category = get_category_by_path($_SERVER[‘HTTP_REFERER’], false); //if category URL was passed if(NULL !== $category) echo $category->name; //otherwise get your random … Read more

Change appearance based on category but post is in two main categories

One easy way is to use has_category function. E.g. in your header you can use if ( has_category(‘pirtek’) ) { $header=”/path/to/pirtek/header” } else { $header=”/path/to/standard/header” } If the post has the ‘kirtek’ category, then the condition inside if is true, no matter what other categories the post belongs to. This kind of if statement can … Read more