Tagged: x
-
AuthorPosts
-
March 3, 2017 at 7:10 pm #1393981
lmradminParticipantIn 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?
March 3, 2017 at 7:14 pm #1393985
lmradminParticipantThis reply has been marked as private.March 4, 2017 at 3:16 am #1394238
Rue NelModeratorHello 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?
March 4, 2017 at 9:04 am #1394420
lmradminParticipantI understand, but if I use that it will disable the Related Posts section for all posts belonging to all categories…
March 4, 2017 at 10:34 am #1394470
ThaiModeratorHi 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 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1393981 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
