It appears that by default I have the following WordPress customizer sections:
- Site Identity
- Homepage Settings
- Additional CSS
I see that I can create new sections, or add customizer fields to a Default Section, but I’m curious if there’s any way to add fields into the pre-existing “Site Identity” or “Homepage Settings” sections?
See the topic titled “Adding a new section,” which has a list of the default section IDs.
Theme Customization API « WordPress Codex
Cool, thank you. I found that section in the article…
title_tagline - Site Title & Tagline (and Site Icon in WP 4.3+)
colors - Colors
header_image - Header Image
background_image - Background Image
nav - Navigation
static_front_page - Static Front Page
I wasn’t sure, but static_front_page does map to the “Homepage Settings” section.
I was able to make a section for “Social Profiles”, but when I add customizer fields, I get a Parse error on the front-end after adding the third field. Also, after I get to 5 fields (of which only 3 show up in the customizer), I get a message that says “Sorry, no more items are available”.
Is there a limit to how many customizer fields can go in a section?
Maybe I’m going about this the wrong way, but I’m taking a site I’ve built in multiple builders (Beaver Builder, Oxygen, Bricks) that had a custom ACF Options page… and I’m trying to move those options into the customizer using PineGrow.
Just starting out, I have a section for “Social Profiles” and inside that I’m trying to add custom link fields:
I’m doing this on the root of index.html with the goal of using these links throughout the site (header, footer, etc).
As stated earlier, as soon as I add the third custom field (no matter what I call it) and then save/export the site to wordpress, I immediately see the following on the front-end:
Parse error : syntax error, unexpected identifier “social_profiles_facebook”, expecting “)” in /Users/Mike/Local Sites/test-theme/app/public/wp-content/themes/test/header.php on line 3
Inside that file I see the following:
href="<?php echo get_theme_mod( 'social_profiles_instagram', '<?php echo get_theme_mod( \'social_profiles_twitter\', \'<?php echo get_theme_mod( \\'social_profiles_facebook\\' ); ?>\' ); ?>' ); ?>">
I’m seeing the same thing you are. Maybe @matjaz can chime in?
You can always create another empty div to hold other customizer fields. They don’t all have to be packed in the same place. See the screenshot below where I used individual divs to hold the section definition and fields. I also tested this and could hold up to three fields in a single div before the section stopped showing them.
@matjaz Is this a bug or expected behavior when adding customizer fields? I can go the div route, but before moving on I just want to make sure I’m doing this properly. I also plan on creating customizer fields for about 7 colors which I haven’t tested yet but might act the same.