0

Not really sure the best way to word this. WordPress stores the CSS in Customizer->Additional CSS in the wp_posts table, with the post_type set to 'custom_css' and the post_name set to the theme slug.

Example:

| post_id | post_content                                                                  | post_name  | post_type  |   |
|---------|-------------------------------------------------------------------------------|------------|------------|---|
| 1       | /* You can add your own CSS here.,Click the help icon above to learn more. */ | theme-slug | custom_css |   |

(Other columns omitted for readability).

For reasons I'm not sure why, additional rows for my theme-slug keep getting created, with the content inside "Additional CSS" reverting back to the default "You can add your own CSS here", with my post_name column value incrementing like 'theme-name-2', 'theme-name-3', so on.

Like so:

| post_id | post_content                                                                  | post_name    | post_type  |   |
|---------|-------------------------------------------------------------------------------|--------------|------------|---|
| 1       | /* You can add your own CSS here. Click the help icon above to learn more. */ | theme-slug   | custom_css |   |
| 2       | /* You can add your own CSS here. Click the help icon above to learn more. */ | theme-slug-2 | custom_css |   |
| 3       | /* You can add your own CSS here. Click the help icon above to learn more. */ | theme-slug-3 | custom_css |   |
| 4       | /* You can add your own CSS here. Click the help icon above to learn more. */ | theme-slug-4 | custom_css |   |

I'm not sure if this is expected WordPress behavior or not. Either way, I am not sure how to troubleshoot what is triggering it. Modifying "Additional CSS" simply updates the row with the highest 'theme-slug-x' value, which I believe is the expected behavior, but I'm not sure why/how these duplicate theme slug rows are getting created to begin with.

Your Answer

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

Browse other questions tagged or ask your own question.