Improve Theme functions
See original GitHub issue- Currently the themes class lacks functionality when it comes to handling checkboxes and radio inputs. (Might be more, but that’s the ones I’m focusing on at the moment)
- Some functions needs to have access to more parameters. (#432 is a good example of this)
- Several themes have different functionality (i.e. some support
infoText
option and other just ignore it) - There’s no way to customize themes at runtime other than overriding functions.
If anyone have worked on creating new themes or modified some of the existing, please post your comments on how we could improve this.
Issue Analytics
- State:
- Created 4 years ago
- Comments:26
Top Results From Across the Web
10 Basic Tips for Improving WordPress Themes - WebFX
10 Basic Tips for Improving WordPress Themes · 1. Reduce the Size of Theme Images · 2. Use a Custom Favicon · 3....
Read more >Theme Functions - WordPress Developer Resources
Theme Setup · Automatic Feed Links · Navigation Menus · Load Text Domain · Post Thumbnails · Post Formats · Theme support in...
Read more >How To Improve And Refine Your WordPress Theme ...
Take advantage of the hierarchy.. Keep code simple and manageable by moving repeated sections of code to their own template files. For example, ......
Read more >10 Tips to Improve Your WordPress Theme - WPShout
10 Tips to Improve Your WordPress Theme · 1. Make your sidebar tabbed · 2. Create a widgetised footer that keeps visitors on...
Read more >How to Customize Your WordPress Theme (5 Step-by ... - Kinsta
Need to change the look of your WordPress theme? Learn how to customize WordPress themes properly using one of the best methods (tutorial)....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lukzas After I wrote the reply about
afterInputReady
, I updated the Spectre theme to get it to look nice with Select2 and Selectize using theafterInputReady
to add/remove classes. The classes are not applied to the input element itself (Since Select2 and Selectice replaces that with a custom select), but on adjacent/sibling element (and it’s children)Since
afterInputReady
is theme specific, you know where the label is based on the input field position. (I think the label element will beinput.parentElement
in Materialize theme)I think this approach is better than adding extra code to the editors, like you did in #205. And also better than adding an extra parameter (Like I did for the
getSelectInput
) It might be a little more complicated than just checking for a parameter, but this way we don’t have to change the theme functions (or add additional code to the editors).Here’s an example from the Spectre theme.
The theme also contains some Inline Style Rules to maker further CSS adjustments to the Select2/Selectize boxes.