• Resolved lance_kidd

    (@lance_kidd)


    Hi,
    I’ve been using WP for quite some time and have never figured this out. How can I use Interal styles for just the specific post or page that I am working on. If I want to use a certain effect for that one post or page, is there a way to do it besides adding it to the child stylesheet?

    There are many styles that I currently use that are for just one post only (example: one page that contains a table with lengthy styles) and there is no need to keep increasing the size of my styles.css file if I can use interal styles between the head tags.

    In-line styles are the only alternative I’ve found but I do not like it. It clutters up the page, especially if you’re styling a table.

Viewing 2 replies - 1 through 2 (of 2 total)
  • This might be a Rube Goldberg solution (and it might not even work), but you asked.

    • Create a Custom Post Type to hold your CSS.
    • Use a Custom Field to name the CPT post with the CSS for the current post.
    • Create a filter on the_content or similar to retrieve and insert the CSS if the Custom Field is present.
    Thread Starter lance_kidd

    (@lance_kidd)

    That’s a pretty cool idea. I may give it a shot just for the heck of experimenting. Thanks for the idea.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Internal Styles’ is closed to new replies.