i need to create a plugin that allows me to select any button or any part of the website and add extra css to it ,i have manages to consumer rest api within wp ,add menus and submit forms but i have no idea how to accomplish this task ,i would appreciate any suggestion thanks
i need to create a plugin that allows me to select any button or any part of the website and add extra css to it ,i have manages to consumer rest api within wp ,add menus and submit forms but i have no idea how to accomplish this task ,i would appreciate any suggestion thanks
Share Improve this question asked Jan 27, 2019 at 15:43 Jawhar JarrarJawhar Jarrar 11 bronze badge 4- Why can't you just add CSS using the Additional CSS section of the customiser? – Jacob Peattie Commented Jan 28, 2019 at 2:51
- i don't want to add css classes,insted i need to add exta css to specific html button/ a tags and so on – Jawhar Jarrar Commented Jan 28, 2019 at 12:41
- Why can’t you do that with regular CSS? – Jacob Peattie Commented Jan 28, 2019 at 13:14
- sorry my bad i didn't explain the issue well , i don't need to add classes to css files but i need to add specfic css classes to tags regardless of their exsitance in a css file , so the task is to change the the html generated by wp and to trigger that i need to click on an item (button,rating....) and a css class to it – Jawhar Jarrar Commented Jan 28, 2019 at 13:24
1 Answer
Reset to default 1I think it's worth studying how other plugins work, for example: Visual Composer.
The logic that came into my head, is to pick the element selector clicked with jQuery, and work on it. Read this that may help you: https://stackoverflow/questions/5706837/get-unique-selector-of-element-in-jquery
Following this logic, if each page element has the same class, it will be easier to work with