• 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?

    • This topic was modified 5 years, 6 months ago by kdickins.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter kdickins

    (@kdickins)

    I’ve managed to add both a name and title to the customizer in the contact us section, but it shows both under the general and details tab. Is there a way to specify which tab it belongs to?

    Hey there

    Can I see it? please provide URL of the page
    also, please note some questions might be the subject of customization and not everything might be supported

    Thread Starter kdickins

    (@kdickins)

    @nodarik
    Unfortunately, I can’t provide the URL to the page because it is in development phase… can I provide the code that I use to create the fields and an image of what it looks like on the front end & customizer?

    I understand that it might not be supported, but I figured I’d ask anyway, since there isn’t a place to say what you can and cannot help with.

    • This reply was modified 5 years, 6 months ago by kdickins.
    • This reply was modified 5 years, 6 months ago by kdickins.

    Good morning

    Unfortunately, the Only code is not enough, I have to see it online ??
    you can refresh this ticket once you go online

    Thread Starter kdickins

    (@kdickins)

    What do you mean by “see it online”?

    Hello

    This means I need to see live website, I need URL of working website

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Contact Us Section; Add Name & Title’ is closed to new replies.