Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1393981
    lmradmin
    Participant

    In Customise>Custom>CSS i have category specific styling like;

    .single-post .category-learn .saboxplugin-wrap {
    display: none;}

    Which works fine, in the same location underneath I have;

    .single-post .category-learn .relatedposts {
    display: none!important;}

    This doesn’t work for some reason, If I remove the ‘.single-post .category-learn’ from the beginning then it works fine.

    Question is, why does the category specific targeting work for one and not for the other?

    #1393985
    lmradmin
    Participant
    This reply has been marked as private.
    #1394238
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! It does not work because you have the wrong class selectors. To resolve it, you only need to have this:

    .single-post .relatedposts {
      display: none!important;
    }

    That is because the related post were not inside the container that bears the category class. You can clearly see it here: http://prntscr.com/efuqt8

    How did you inserted the Related post section? Is it by using a custom template or some functions?

    #1394420
    lmradmin
    Participant

    I understand, but if I use that it will disable the Related Posts section for all posts belonging to all categories…

    #1394470
    Thai
    Moderator

    Hi There,

    Please try adding the following code under Customizer > Custom > Global Javascript:

    jQuery(function($){
    	$(document).ready(function(){
    		if($('.single article').hasClass('category-learn')){
    			$('.relatedposts').remove();
    		}
    	});
    });

    Hope it helps 🙂

  • <script> jQuery(function($){ $("#no-reply-1393981 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>