Title: creating a simple plugin for CSS changes
Last modified: August 12, 2021

---

# creating a simple plugin for CSS changes

 *  [digikal117](https://wordpress.org/support/users/digikal117/)
 * (@digikal117)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/creating-a-simple-plugin-for-css-changes/)
 * Hi. I need to create a very simple plugin so that my client can easily control
   the appearance of certain elements by simply using checkboxes. Those checkboxes,
   being ticked or not ticked, would send different CSS codes to certain ID’s on
   the website.
 * The thing is that I don’t have that much PHP experience. Could you recommend 
   to me any resource that could help me achieve this goal?
 * Also, if you think the task is much more difficult than I thought it to be, please
   let me know.
 * Thanks in advance!

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/creating-a-simple-plugin-for-css-changes/#post-14761914)
 * I’m not sure how difficult you think it is 🙂 I say go ahead and give it a go.
   Whatever struggles you encounter from lack of experience will be useful learning
   opportunities.
 * Where would this list of check boxes occur? Logical places are the customizer
   or a separate plugin page accessed from the left side admin menu. The latter 
   is probably easier, but the customizer would be considered a more up to date 
   way to get user input. You can add a plugin admin page using `add_menu_page()`.
 * The callback function passed to `add_menu_page()` will be responsible for not
   only getting any saved data and outputting the checkbox list within a HTML form,
   but also for handling the form submission when the user saves their selections.
   All selections can be collected into an array which is then saved as a specific
   option value with `update_option()`.
 * With selections saved as an option, you now need to generate inline CSS based
   on them. Output the CSS from a callback added to the “wp_head” action. Add while
   passing a large priority argument so that your CSS is output late, thus overriding
   any earlier CSS that established default values. The callback would get the saved
   option value and output appropriate CSS within `<style>` tags.
 * I suggest starting with only a couple checkbox items. Develop the needed code
   to get those fully working before adding the rest. Focus on developing small 
   functional parts at a time and test your code very frequently.

Viewing 1 replies (of 1 total)

The topic ‘creating a simple plugin for CSS changes’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/creating-a-simple-plugin-for-css-changes/#post-14761914)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
