I need to hide some elements in my posts pages, but not in all the other normal pages. Now they appear in all my Wordpress site (single post, page, etc).

How can I hide by CSS an element? This element has a single class <div class="frame-content".

Can I do something like: if <post> then .frame-content{display:none;}?

  • add css style in your style sheet .single .frame-content {display: none;} Dec 27, 2018 at 13:27

1 Answer 1


This worked for me:

<?php if( is_single() ) : ?>
<style id="my-internal-css">
    .frame-content {
       display: none !important;
<?php endif; ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.