How to add the 6th header slider? Or can I add?

Hi,

There are already 5 header sliders. But I would like to add the 6th one. Can I? How?

Thanks!

Hi,

You can add sixth option by adding this code to inc / customizer.php to line 536:

//Image 6
    $wp_customize->add_setting('sydney_options[info]', array(
            'type'              => 'info_control',
            'capability'        => 'edit_theme_options',
            'sanitize_callback' => 'esc_attr',            
        )
    );
    $wp_customize->add_control( new Sydney_Info( $wp_customize, 's6', array(
        'label' => __('Sixth slide', 'sydney'),
        'section' => 'sydney_slider',
        'settings' => 'sydney_options[info]',
        'priority' => 30
        ) )
    );    
    $wp_customize->add_setting(
        'slider_image_6',
        array(
            'default-image' => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );
    $wp_customize->add_control(
        new WP_Customize_Image_Control(
            $wp_customize,
            'slider_image_6',
            array(
               'label'          => __( 'Upload your sixth image for the slider', 'sydney' ),
               'type'           => 'image',
               'section'        => 'sydney_slider',
               'settings'       => 'slider_image_6',
               'priority'       => 31,
            )
        )
    );
    //Title
    $wp_customize->add_setting(
        'slider_title_6',
        array(
            'default' => '',
            'sanitize_callback' => 'sydney_sanitize_text',
        )
    );
    $wp_customize->add_control(
        'slider_title_6',
        array(
            'label' => __( 'Title for the sixth slide', 'sydney' ),
            'section' => 'sydney_slider',
            'type' => 'text',
            'priority' => 32
        )
    );
    //Subtitle
    $wp_customize->add_setting(
        'slider_subtitle_6',
        array(
            'default' => '',
            'sanitize_callback' => 'sydney_sanitize_text',
        )
    );
    $wp_customize->add_control(
        'slider_subtitle_6',
        array(
            'label' => __( 'Subtitle for the sixth slide', 'sydney' ),
            'section' => 'sydney_slider',
            'type' => 'text',
            'priority' => 33
        )
    );
  • add this right above this code:

//Header button

and from the header button area change the priority:

$wp_customize->add_control( new Sydney_Info( $wp_customize, 'hbutton', array(
        'label' => __('Call to action button', 'sydney'),
        'section' => 'sydney_slider',
        'settings' => 'sydney_options[info]',
        'priority' => 30
        ) )
    );     
    $wp_customize->add_setting(
        'slider_button_url',
        array(
            'default' => '#primary',
            'sanitize_callback' => 'esc_url_raw',
        )
    );
    $wp_customize->add_control(
        'slider_button_url',
        array(
            'label' => __( 'URL for your call to action button', 'sydney' ),
            'section' => 'sydney_slider',
            'type' => 'text',
            'priority' => 31
        )
    );
    $wp_customize->add_setting(
        'slider_button_text',
        array(
            'default' => __('Click to begin','sydney'),
            'sanitize_callback' => 'sydney_sanitize_text',
        )
    );
    $wp_customize->add_control(
        'slider_button_text',
        array(
            'label' => __( 'Text for your call to action button', 'sydney' ),
            'section' => 'sydney_slider',
            'type' => 'text',
            'priority' => 32
        )
    );

change 30 to 34, 31 to 35 and 32 to 36, so the options in the customizer will be in correct order

Then add this code to inc / slider.php to line 74:

if ( get_theme_mod('slider_image_6') ) {
                    echo '<div class="slide-item" style="background-image:url(' . esc_url(get_theme_mod('slider_image_6')) . ');"></div>';
				}

just below this code:

if ( get_theme_mod('slider_image_5') ) {
                    echo '<div class="slide-item" style="background-image:url(' . esc_url(get_theme_mod('slider_image_5')) . ');"></div>';
				}

and then add this code to line 123:

<?php if ( get_theme_mod('slider_image_6') ) : ?>
                    <li>
                        <div class="contain">
                            <h2 class="maintitle"><?php echo esc_html($slider_title_6); ?></h2>
                            <p class="subtitle"><?php echo esc_html($slider_subtitle_6); ?></p>
                        </div>
                    </li>
                    <?php endif; ?>

just below this code:

<?php if ( get_theme_mod('slider_image_5') ) : ?>
                    <li>
                        <div class="contain">
                            <h2 class="maintitle"><?php echo esc_html($slider_title_5); ?></h2>
                            <p class="subtitle"><?php echo esc_html($slider_subtitle_5); ?></p>
                        </div>
                    </li>
                    <?php endif; ?>

Please let me know how it works.

Best Regards,
Csaba

Hi
where can I find the customerizer.php file? I am currently using a child theme doing my website. Thanks.

Website: http://petsittingdiary.com

I found the customizer.php file which is in the Sydney theme file. Do I need to move it to my sydney child theme file first, and then do the adjustment you provided to me?

I think I cannot edit my previous post. Sorry for continuous posting. Final question, if I need to move the customizer.php to the child theme first, should I move the entire “inc” file from sydney theme file to the child theme file? Or just move the customizer.php is good enough?

All in all, three questions:

  1. Do I need to move the customizer.php file and slider.php file from the sydney theme to my sydney child theme first, and then do the adjustment you provided to me?
  2. The contents of Line 74 and Line 123 in the slider.php are not the same as you mentioned. So I cannot move forward.

Please help

Hi,

Yes, if you are using a Child Theme, then add the files to your Child Theme using the same folder structure ( mentioned in my previous post ). The line numbers can be different from version-to-version, so better check for the exact code I’ve gave you, it should be around the specified line numbers ( if not at the same ).

Best Regards,
Csaba

Hi,

The Sixth slider apparently added to the customizer, but it actually didn’t appear in the website. You can have a look at petsittingdiary.com.

Please help!

Thanks!

Hi,

Please give me an admin access / link to your site in email to csaba . athemes @ gmail . com and also, please send a link to this topic, so I can know what to check.

Best Regards,
Csaba

Have sent an email to you yesterday. Thanks for your time and help!

Hi,

Ok, I have already replied to you via Email, please continue there.

Best Regards,
Csaba

Dear csaba, i followed your instructions above but i, too, couldn’t get the 6. slide work. Besides, i need left and right arrows and nav dots on the lower edge of the slider.
Thanks.

Btw. i am using Sydney Pro 1.57. I tried to upgrade to 2.0.3, no success.

Hi,

If you’re using Sydney Pro, please post a new topic in Sydney Pro Forums, about the arrows I can help if you post a link to your website.

Kind Regards,
Csaba

Thank you for your support, Csaba. I will post a new topic in Sydney Pro Forums right now.

Hi @p_turkeryahoo-com,

Ok, I will check. I will close this topic @chuchubbbb3 if you need more help please open a new topic.

Kind Regards,
Csaba