S
S
serega 20702018-11-23 12:04:47
Themes
serega 2070, 2018-11-23 12:04:47

How to customize category template in wordpress without category prefix?

Hello guys! pliz tell me who is in the know, I delete the prefix / category in wp through function.php, in this way

function true_remove_category_from_category($cat_url) {
  $cat_url = str_replace('/category', '', $cat_url);
  return $cat_url;
}
add_filter('category_link', 'true_remove_category_from_category', 1, 1);

and in the topic there are templates for categories, well, type category-template_name, after you remove the category prefix, all templates fly off (
I can’t find similar questions in Google

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan Hasanli, 2018-11-23
@pecha89

Hello!
1) don't confuse category and template name category. The category template name should be categorx-xxx.php
2) to remove the category base slug just install this plugin
https://ru.wordpress.org/plugins/no-category-base-wpml/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question