Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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 categories

    My 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

    #1366820

    Hey 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,
    Mike

    #1366860

    hi 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

    #1366898

    Hi,
    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,
    Mike

    #1366922

    very good :-) thx a lot Mike & best regards, Tilman

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘hide ONE Blog category’ is closed to new replies.