简体   繁体   中英

Customizable boxes in Wordpress Theme

I'm trying to create my first theme based on old project. My main problem is with Home Page, which contains 3 boxes with features, filled with lorem ipsum. I could simply leave it static, but that would force theme user to manually edit it. How experienced WP theme developers handle this?

I thought about custom fields, but It would be tricky for someone not familiar with WP. My current idea is to add admin sub-page in appearance menu, dedicated for home page - where user could change content in boxes and other elements. But I don't know if themes supposed to interfere with admin at all, it's more of plugin thing. Default texts (lorem ipsum) would be hard-coded if setting didn't exist, because I read that themes/plugins shouldn't insert their defaults.

dedicated admin page is a good idea however for few small control you can use (Theme Customization API) https://codex.wordpress.org/Theme_Customization_API . I hope this will help you out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM