Set taxonomy slug as taxonomy title

The terms are inserted with wp_insert_term() and updated with wp_update_term(). There’s the pre_insert_term filter, where one can modify the term’s name but not the slug. If we dig further, we see that both functions call sanitize_term() that again calls the sanitize_term_field() function. There we have various filters available. Example #1 Here’s one combination if we … Read more

How I Can Use The Get Value as A Slug

You don’t need to do anything with rewrite rules. Your example (“domain.com/example-slug/?holder=value”) is a perfect example of “Plain” Permalinks. So your starting point is to set Permalinks (Settings > Permalinks) to something other than “Plain”. This will take the “/?” component out of the URL, and generate a URL in your preferred format. The second … Read more

Add parent template name to body class filter when visiting subpage or single post

here: add_filter(‘body_class’,’body_class_slugs’); function body_class_slugs($classes) { global $posts,$post; if(is_single() || is_page()){ //only on a single post or page if (isset($posts)){ $classes[] = $post[0]->post_name; //posts is an array of posts so we use the first one by calling [0] } elseif (isset($post)){ $classes[] = $post->post_name; } } return $classes; }

Yoast SEO breadcrumbs: how to create a filter that uses the url slug for breadcrumb titles

Yoast does have a filter for you to use. See here: https://gist.github.com/jmcclellan/b2d97ffee0e924e28fa1 I used this to add “parent” pages to custom post types. We wanted to use pages as our category landers w/ custom post types as children. Yoast would not output the parent page slug by default since there is technically no real relationship, … Read more

Display page over category archive

Option #1 Add a theme file for each category, instead of adding a Page for each category. You would create a file called category-news.php which would only display for the news category at /news/, plus files for each other category, such as category-other.php which would display for the other category at /other/. Then just place … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)