Contact Us Section; Add Name & Title
-
Hello,
On the contact section on the front page, I would like to add a Title & Name to the .box-right-row class. This includes adding an input section for both items for my users to add. Please assist me in this.
I added the following code in the following locations:
illdy-child/sections/front-page-contact-us.php
<?php if ( $name ) : ?> <span class="box-right-row" data-customizer="contact-us-name"><?php _e( 'Name:', 'illdy' ); ?> <?php echo illdy_sanitize_html( $name ); ?></span> <?php endif; ?> <?php if ( $title ) : ?> <span class="box-right-row" data-customizer="contact-us-title"><?php _e( 'Title:', 'illdy' ); ?> <?php echo illdy_sanitize_html( $title ); ?></span> <?php endif; ?>
illdy-child/inc/customizer/customizer.php
if ( ! function_exists( 'illdy_name' ) ) { function illdy_name() { return get_theme_mode( 'illdy_name' ); } } if ( ! function_exists( 'illdy_title' ) ) { function illdy_title() { return get_theme_mode( 'illdy_title' ); } }
illdy-child/inc/customizer/panels/contact-us.php
// Name $wp_customize->add_setting( $prefix . '_name', array( 'sanitize_callback' => 'illdy_sanitize_html', 'default' => __( 'name ', 'illdy' ), 'transport' => 'postMessage', ) ); $wp_customize->add_control( $prefix . '_name', array( 'label' => __( 'Name', 'illdy' ), 'section' => $prefix . '_contact_us', 'priority' => 10, ) ); $wp_customize->selective_refresh->add_partial( $prefix . '_name', array( 'selector' => '#contact-us .section-content .row .col-sm-5 .box-right span:first-child', ) );
Am I on the right track, or am I doing this incorrectly?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Contact Us Section; Add Name & Title’ is closed to new replies.