Customizing Styles for the LG Contact Form
If the default styles we provide don’t quite meet your needs and you’d like to make small adjustments or even create a completely custom design for the form and its elements, we’ve got you covered! Here’s our recommended approach:
For Convertify Theme Users
- Download the LG Contact Form Templates:
- Start by downloading the templates provided with the LG Contact Form.
- In the form settings, select “Inherit from Theme (Child Theme)” under the Form Style option.
- Use the Preconfigured Child Theme:
- If you’re using the Convertify Theme, you’re in luck! A well-configured child theme is included with your subscription.
- Simply navigate to the
lg-form-style.css
file within the child theme. - Paste the contents of one of the downloaded template files into
lg-form-style.css
and customize it to your liking.
For Users of Other Themes
If you’re using a different theme, follow these steps to create and configure a child theme:
- Create a Child Theme Folder:
- In your WordPress installation, go to the
wp-content/themes/
directory. - Create a new folder and name it something like
{parent-theme-name}-child
(replace{parent-theme-name}
with the actual name of your parent theme).
- In your WordPress installation, go to the
- Add a
style.css
File:- Inside the child theme folder, create a file named
style.css
. - Add the following code at the top of the file:
- /* Theme Name: {Parent Theme Name} Child Theme Template: {parent-theme-name} Description: A child theme for {Parent Theme Name}. */
- Replace
{Parent Theme Name}
and{parent-theme-name}
with the name of your parent theme. This ensures WordPress recognizes the connection between the child and parent themes.
- Inside the child theme folder, create a file named
- Add a
functions.php
File:- Create a
functions.php
file in the child theme folder. - Paste the following code to enqueue the necessary stylesheets:
- <?php // Enqueue child theme styles function custom_child_theme_styles() { // Enqueue the parent theme’s stylesheet wp_enqueue_style(‘parent-style’, get_template_directory_uri() . ‘/style.css’); // Enqueue the child theme’s stylesheet wp_enqueue_style(‘child-style’, get_stylesheet_uri(), array(‘parent-style’)); // Enqueue additional stylesheet for the LG Contact Form wp_enqueue_style(‘lg-form-style’, get_stylesheet_directory_uri() . ‘/css/lg-form-style.css’, array(‘parent-style’)); } add_action(‘wp_enqueue_scripts’, ‘custom_child_theme_styles’); ?>
- Create a
- Add the
css
Folder andlg-form-style.css
File:- Inside the child theme folder, create a
css
folder. - Add a file named
lg-form-style.css
to thecss
folder. - Paste the contents of one of the downloaded LG Contact Form templates into this file and customize it as needed.
- Inside the child theme folder, create a
Why Use a Child Theme?
Ease of Use: With clear file structures and templates, even beginners can make impactful customizations.
Preserve Customizations: Updates to the parent theme won’t overwrite your changes.
Flexibility: Tailor the form’s design to perfectly match your site’s aesthetic.