Tagged: blog category
-
AuthorPosts
-
September 28, 2022 at 3:32 pm #1366732
Dear Team,
on my page below I use blog categories.on post a) I use top right (small font) the metadata element -> categories
on post b) I use the blog sidebar widget -> blog categoriesMy issue:
On a) “DE” is added as a category. I guess it´s it may be the posts language (?). Maybe it is related to loco translate as I have DE and ENG pages? In the blog category overview “DE” is not shoen.-> How can I avoid that DE is displayed on a)?
Thx a lot & best regards Tilman
September 29, 2022 at 12:51 am #1366820Hey Tilman,
Thanks for the link to your page, to remove the category link “DE” and the comma after it
try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:function custom_script() { ?> <script> window.addEventListener('DOMContentLoaded', function() { (function($) { $('#top.postid-6592 .av-post-metadata-category-link a:contains("DE")').each(function(){ $(this).css({'display':'none'}); $('#top.postid-6592 .av-post-metadata-category').contents().filter(function() { return this.nodeType === 3; }).eq(1).remove(); }); }(jQuery)); }); </script> <?php } add_action('wp_footer', 'custom_script');
Best regards,
MikeSeptember 29, 2022 at 9:38 am #1366860hi Mike,
great, this works. Maybe I was not clear: I want to delete the “DE” category on ALL blog posts, not on a specific post only.-> What would be the related functions syntax?
Cheers, Tilman
September 29, 2022 at 2:08 pm #1366898Hi,
Try this instead:function custom_script() { ?> <script> window.addEventListener('DOMContentLoaded', function() { (function($) { $('#top.single-post .av-post-metadata-category-link a:contains("DE")').each(function(){ $(this).css({'display':'none'}); $('#top.single-post .av-post-metadata-category').contents().filter(function() { return this.nodeType === 3; }).eq(1).remove(); }); }(jQuery)); }); </script> <?php } add_action('wp_footer', 'custom_script');
Best regards,
MikeSeptember 29, 2022 at 3:31 pm #1366922very good :-) thx a lot Mike & best regards, Tilman
-
AuthorPosts
- The topic ‘hide ONE Blog category’ is closed to new replies.