[Support request] Metabox Simple CSS on posts / pages edit screens

Home Forums Support [Support request] Metabox Simple CSS on posts / pages edit screens

Home Forums Support Metabox Simple CSS on posts / pages edit screens

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #216914
    Roland

    Hi Tom,

    I wanted to vertical align text in a table. It’s about this page: http://einfachgutschreiben.com/lorem-ipsum/

    In the bottom of the post edit screen I found the metabox Simple CSS. I wrote this code in the box:

    td, th {
    	vertical-align: top;
    }

    That doesn’t work at all.

    I cut the code und copied it in the Simple CSS editor (Appearance, Simple CSS). That works fine.

    Now I’m wondering what is the metabox on the pages / posts edit screens good for? What is the difference between writing code in the metabox and writing code in the editor?

    Kind regards
    Roland

    #216945
    Leo
    Staff
    Customer Support

    Hi Roland,

    I am pretty sure they should both work. The codes in the metabox on the pages/posts would only effect that specific page/post. The codes in the editor would effect all pages in your site (in your case all the tables on the site). I’m not quite sure why it didn’t work for you though…did you have other CSS in the metabox that might be breaking it?

    Tom please correct me if I’m wrong πŸ™‚

    #217053
    Tom
    Lead Developer
    Lead Developer

    Exactly πŸ™‚

    #217214
    Roland

    Hi Leo, hi Tom,

    thank you! πŸ™‚

    It was my fault, I think I wrote the code in the post http://einfachgutschreiben.com/lorem-ipsum/, but I controlled the changes on the blog’s page http://einfachgutschreiben.com/tipps/. Sorry!

    It works fine, but now another “problem” occured. There is one page where the code, written in the metabox of the page, still doesn’t work – it’s the blog’s page http://einfachgutschreiben.com/tipps/. Precisely:

    Post: http://einfachgutschreiben.com/lorem-ipsum/
    It works.

    Page: http://einfachgutschreiben.com/coaching/
    It works.

    Blog’s Page: http://einfachgutschreiben.com/tipps/
    It doesn’t work.

    Maybe the metabox’s behaviour is different on the blog’s page?

    #217253
    Leo
    Staff
    Customer Support

    It should behave the same on blog page. I just tested out using inspect element and the same code worked for me.
    Are there other CSS in the blog metabox that might be breaking the code?
    On that note, if you want every table to style like that, you can try entering the code in the actual editor? That way you don’t have to enter the same code on every single page πŸ™‚

    #217270
    Tom
    Lead Developer
    Lead Developer

    The blog page (any page set as the posts page) will ignore all metaboxes – it’s just the way WordPress works I’m afraid.

    If you’re going to be targeting CSS for the blog only, it needs to be added into the global CSS (Appearance > Simple CSS) with the .blog selector:

    .blog .my-selector,
    .archive .my-selector {
        /* CSS in here will show up on your main posts page and archives */
    }
    #217279
    Leo
    Staff
    Customer Support

    Thanks for the correction πŸ™‚ Just making sure, the CSS entered in the global editor would also work on blog page without the .blog selector? (if we are not targeting blog only)

    #217281
    Tom
    Lead Developer
    Lead Developer

    That’s correct πŸ™‚

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.