In the first part of this series, I introduced different types of theme frameworks and explained how they work.
Before you start building your theme framework, you need to think about how it works and what it will be used to do so that you can find the right development path from the start.
In this lesson, I'll walk you through each of the areas you need to consider, including whether your framework is open to the public, non-programmer or developer use it, and other features you might want to add.
To determine your development path, take two steps: First, determine how your theme framework will be used, and, on that basis, identify all the content you need to include.
How do I use your theme framework?
The way you use the theme framework affects what you want to include and how you build the framework.
Consider the following:
- Your subject frame audience--just you or some other developer?
- Will your theme framework be available to developers or users with little or no programming experience?
- Will your theme framework be open to the public?
Is it just you or some other developer?
If your framework is just for your personal needs, you need to think about your own needs while you develop it, but in the long run it makes sense to try to build it as steady as possible from the start, so you should:
- Using the WordPress encoding standard
- Apply dry (never copy yourself) principle
- Use the user authentication Checker to validate the code and make sure that your code is accessible.
- Add code descriptions--even if someone doesn't look at your code, you'll be amazed how easy it is to forget a piece of code when you write again many months later.
- Use the update for the version control framework.
If your theme framework is being made available to other developers (perhaps your colleagues), then in addition to all of the above, you may also need to:
- Provides an overview file of framework structures, functions, and hooks.
- Consider the way you share and collaborate on code-using a collaborative system makes it all the more simple, like GitHub.
- Record your version, or connect them to "milestones" (milestones) and/or release on GitHub.
To a developer or user?
Some of the topic frameworks are designed to be used by users who do not encode, who can extensively customize the theme framework without writing any code, while others are intended for developers to provide hooks and functions that they can use to customize and expand their own frameworks. And there are both, there is a comprehensive user interface and an API (Application interface).
Your framework will be used by non-developers and does not mean that you have to release it to the public-you may have coworkers who are web designers, you want to give them access to permissions, or let your customers use your framework to customize their site.
If your frame is facing a user who is not coding, you need to consider:
- One or more of the theme options interface so that your users can define their own.
- You can choose to use the theme customizer instead of the theme options interface, with the advantage that users can see their changes directly while customizing the theme, or both.
- Gadget area, which allows users to add their own content to different places on a Web page.
- Menu so that users can browse the site (the area containing the menu may be more than one, which you decide).
- Sub-themes support so that users can quickly install and create a work site.
- Library that contains all the features you want, such as sliders or lightbox effects.
- necessary documentation and related help so that users know how to use all of your results (some of which are very useful, but remember to slow down and gradually improve)
If your target audience is a professional developer who will use your theme framework together with their subtopics and/or plugins, then you might want to consider some of the above, but you also need to consider the following list of features:
- Action hooks allows developers to insert their own code into your template file without having to create a duplicate template file.
- Filtering hooks (filter hooks) Allow developers to modify the output of the template file.
- Developers can use custom functions in their sub-themes.
- The template section and the include file to reduce duplication of code. This will benefit you a lot when using the framework, and other developers will find it useful if you theoretically need to create a template file in a sub-topic.
- Make sure that your file naming and structure logic is logical and that you want to add the appropriate instructions to these files so that people can easily find them.
Open or not?
If you plan to release your framework to the public, there is a whole set of other things to consider:
- If you are submitting your framework as a theme through the WordPress theme Library, you will need to follow the topic Review Guide.
- Since users may be able to use your framework in any scenario and site type, you need to test whether your framework is working in a variety of environments, and perhaps you can enlist other users and developers to help you with this test.
- Certain types of documents are essential for both developers and users, depending on your target audience, of course.
You also need to consider how to market your framework: even if it is free, if you want more people to use it, then you need to advertise it through a website, other ways are social media, search engine optimization (SEO), third party Theme store, word of mouth, local party, Wordcamps Convention (by WordPress users spontaneously organized non-profit nature of the conference) and so on.
Elixir-restaurant WordPress Theme
What should you include in your theme framework?
A large part of the functionality of your theme will be determined by the needs of the users you have just identified. When deciding on a subject frame audience, if possible, ask your audience for specific needs and then list some of the features that your theme will contain.
This list will include (but are not limited to) the following selections:
- Template files (including template sections and include files)
- Function
- Action hooks (action hooks) and filtering hooks (filter hooks)
- Gadget area
- Directory
- Options and Settings interface
- Theme Customizer Support
- File
- Child theme
For these, you need to confirm:
- What is its specific function?
- What it will do
- Where will its code appear
In addition to these features that are determined by different user groups, you may also want to include other features such as:
- Does your frame have a built-in layout? Is this layout configurable or will it be encoded by sub-themes?
- How much of this feature will be in your parent's topic? Some frameworks have extreme minimum styles, while others (like myself) use object-oriented CSS (OOCSS) to make styling easier in sub-themes.
- Is your frame responsive or is it encoded by a sub-theme? If your parent topic is responsive, you need to make sure that it is not covered by any layout style in the area where the sub-topic oocss can be useful.
- Will you add SEO (Search engine Optimization) to your framework, is it provided by WordPress, or is it added by users using a standalone plugin?
- If it is necessary to add it within your frame or through a sub-theme, will you include such things as sliders, galleries, background images, and so on?
This list may change over time as your own and user needs change. Make sure your framework is easy to expand from the start, and you can add new features whenever you want.
Summary
Developing your own theme framework can be said to be a big initiative. In the long run, this will save you a lot of development time, but it also takes a lot of work.
Take the time to learn about the audiences that use the theme framework and what features they need, because it makes sense and value for both yourself and other users, and it's much easier to extend and modify the framework in the future.
The above describes the decision on how to develop your WordPress theme framework, including aspects of the content, I hope the PHP tutorial interested in a friend helpful.