0

I'd like to insert some CSS on a specific post type's backend area. So not globally. I've found lots of ways to insert it everywhere, but can't figure out how you'd target posts only. Any ideas?

15
  • You could wrap it in a if condition, is_single() or is_singular(), adding your enqueued code into the question would help understand how you are adding your style. Commented Dec 15, 2021 at 12:32
  • 1
    What part of the backend do you want to style? And are you using the Classic Editor or the Block Editor? Commented Dec 15, 2021 at 12:34
  • @Buttered_Toast How would that look? Commented Dec 15, 2021 at 12:34
  • @JacobPeattie The "edit post" part. I'd like this to work no matter which I choose, but Classic at the moment. Commented Dec 15, 2021 at 12:36
  • @Fluxian So the actual content inside the Visual editor? I ask because it's a different process to style that than the editor itself. Commented Dec 15, 2021 at 12:40

1 Answer 1

-4

Just use the Page-ID class e.g. 123 and use plugin like Custom CSS. There you do:

.page-id-123 { 

font-size: 100px; }

You may need to add a class as well if you want to style a certain object.

2
  • What page-id is shared across all posts of a certain type in the wp-admin area? Commented Dec 15, 2021 at 12:33
  • 1
    this works for the frontend, it does not work for the backend, the question is for WP Admin Commented Dec 15, 2021 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.