Guest User

Untitled

a guest
May 10th, 2024
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. add_filter('single_template', function ($template) {
  2. global $post;
  3. // Replace 'gadgets' category with the slug of your category
  4. if ( has_category('gadgets', $post) ) {
  5. $new_template = locate_template(array('parts/single/single_template_7.php'));
  6. if (!empty($new_template)) {
  7. return $new_template;
  8. }
  9. }
  10. return $template;
  11. });
Advertisement
Add Comment
Please, Sign In to add comment