I am fairly new to Wordpress development so I apologize for my ignorance.
How can I alter the static information on my pages (IE not entries or page content) through the Theme Customizer API?
Is it possible to change static text on my pages so that I can allow my client to access the Theme Costumizer API and alter the text of paragraphs, buttons, h1's and such?
I know I can do this for things such as the page title and the page motto, also the page logo, but I wanna know if I can make more static info editable through this API. Or perhaps the better approach is to create metaboxes for specific pages and tell my client to type the text he wants on the metaboxes, but this does not have the visual dynamic appeal that the Theme Customizer API seems to have.
Hopefully I phrased my question properly, and thank you in advance.
I am fairly new to Wordpress development so I apologize for my ignorance.
How can I alter the static information on my pages (IE not entries or page content) through the Theme Customizer API?
Is it possible to change static text on my pages so that I can allow my client to access the Theme Costumizer API and alter the text of paragraphs, buttons, h1's and such?
I know I can do this for things such as the page title and the page motto, also the page logo, but I wanna know if I can make more static info editable through this API. Or perhaps the better approach is to create metaboxes for specific pages and tell my client to type the text he wants on the metaboxes, but this does not have the visual dynamic appeal that the Theme Customizer API seems to have.
Hopefully I phrased my question properly, and thank you in advance.
You could put that kind of thing in the Customizer, but I wouldn't. It's probably too much content for there, which is really designed for site-wide settings, not content on individual pages.
A better approach is closer to what you were saying, storing meta information on individual pages. While meta boxes by default are not visually appealing, there are several meta plugins that do a good job of presenting editable fields in a friendly way. The one I use is Advanced Custom Fields (ACF). There's 3 parts:
You can create text fields, text areas, links, checkboxes, etc. Even better, you can create "repeater fields", i.e. allow the user to create several of a specific thing, groups, conditional logic, and more. Each field you create gets a slug by which you will reference it.
Each group you set up there you also assign to pages and posts conditionally.
ACF provides a lot of great helper functions. The most simple is get_field('____'). So if you created a field called "Page Subtitle", it probably got the slug, "page_subtitle", and on your page template you might write,
if ( get_field( "page_subtitle" ) ){
echo "<h2 class='page-subtitle'>" . get_field( "page_subtitle" ) . "</h2>";
}
Repeater fields are a little more complex, but the ACF site has a ton of great examples.
Gutenberg was introduced in WordPress 5.0, and it replaces the content editor. If possible, it's worth seeing if you can embrace the Gutenberg mindset of letting users define the page layout using predefined blocks.
There is still a place for post meta, i.e. when you need a field for a part of a page that is not part of the main content area, but whenever you are able to use blocks instead you give your user more control over when and where layout elements appear.
There's even a new supercharged form of custom fields where you create custom fields for custom blocks!
More and more of WordPress in the near future will likely revolve around this type of approach, so this is a good time to jump in and embrace it.