Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Sorry, the last code was wrong, this is the correct one.

    functions.php:

    if ( esc_url(of_get_option('slide-image', get_template_directory_uri() . '/images/slide-image/slide-image2.jpg')) != '' || esc_url(of_get_option('extra-image', get_template_directory_uri() . '/images/slide-image/slide-image3.jpg')) != '' || esc_url(of_get_option('extra-image1', get_template_directory_uri() . '/images/slide-image/slide-image4.jpg'))  != '') :
    	wp_enqueue_script( 'simplify-slider', get_template_directory_uri(). '/js/jqFancyTransitions.1.8.min.js', array( 'jquery' ) );
    	endif;

    Hi, you just solve my issue and no one solves yours, so look, you have to change the code in 3 places:

    [Moderator note: Best practice is to use a child theme for any modifications to a theme – otherwise the files you modified will be overwritten and lost when the theme is updated:
    http://codex.wordpress.org/Child_Themes ]

    front-page.php
    options.php
    functions.php

    So , let’s start. You say you want to have a 4th slide, and your problem is that you’re calling the same image, look you have ‘extra-image’ so that is the ID, if you change it for ‘extra-image1’ it’ll work for an extra slide

    frontpage.php

    <?php if ( esc_url(of_get_option('extra-image1', get_template_directory_uri() . '/images/slide-image/slide-image4.jpg')) != '' ) : ?>
    
    <img src="<?php echo esc_url(of_get_option('extra-image1', get_template_directory_uri() . '/images/slide-image/slide-image4.jpg')); ?>"/>
    <?php endif; ?>

    so, the entire code will be like:

    <div id="slide-container">
    <div id="slide">
    <img src="<?php echo esc_url(of_get_option('banner-image', get_template_directory_uri() . '/images/slide-image/slide-image1.jpg')); ?>"/>
    
    <?php if ( esc_url(of_get_option('slide-image', get_template_directory_uri() . '/images/slide-image/slide-image2.jpg')) != '' ) : ?>
    
    <img src="<?php echo esc_url(of_get_option('slide-image', get_template_directory_uri() . '/images/slide-image/slide-image2.jpg')); ?>"/>
    <?php endif; ?>
    
    <?php if ( esc_url(of_get_option('extra-image', get_template_directory_uri() . '/images/slide-image/slide-image3.jpg')) != '' ) : ?>
    
    <img src="<?php echo esc_url(of_get_option('extra-image', get_template_directory_uri() . '/images/slide-image/slide-image3.jpg')); ?>"/>
    <?php endif; ?>
    
    <?php if ( esc_url(of_get_option('extra-image1', get_template_directory_uri() . '/images/slide-image/slide-image4.jpg')) != '' ) : ?>
    
    <img src="<?php echo esc_url(of_get_option('extra-image1', get_template_directory_uri() . '/images/slide-image/slide-image4.jpg')); ?>"/>
    <?php endif; ?>
    
    </div>
    </div> <!-- slide-container -->

    options.php try to find this code and replace it:

    $options[] = array(
    		'name' => __('Banner Image/ Slide Image 01',  'simplify'),
    		'desc' => __('Upload an image for the Front Page Banner. 930px X 350px image is recommended.',  'simplify'),
    		'id' => 'banner-image',
    		'std' => get_template_directory_uri() . '/images/slide-image/slide-image1.jpg',
    		'type' => 'upload');
    
    	$options[] = array(
    		'name' => __('Slide Image 02',  'simplify'),
    		'desc' => __('Upload an image for the Front Page Banner. 930px X 350px image is recommended. Leave this field blank if you do not want any slider.', 'simplify'),
    		'id' => 'slide-image',
    		'std' => get_template_directory_uri() . '/images/slide-image/slide-image2.jpg',
    		'type' => 'upload');
    
    	$options[] = array(
    		'name' => __('Slide Image 03',  'simplify'),
    		'desc' => __('Upload an image for the Front Page Banner. 930px X 350px image is recommended. Leave this field blank if you do not want any slider.', 'simplify'),
    		'id' => 'extra-image',
    		'std' => get_template_directory_uri() . '/images/slide-image/slide-image3.jpg',
    		'type' => 'upload');	
    
    	$options[] = array(
    		'name' => __('Slide Image 04',  'simplify'),
    		'desc' => __('Upload an image for the Front Page Banner. 930px X 350px image is recommended. Leave this field blank if you do not want any slider.', 'simplify'),
    		'id' => 'extra-image1',
    		'std' => get_template_directory_uri() . '/images/slide-image/slide-image4.jpg',
    		'type' => 'upload');

    So, now you can upload from the simplify options, and the last step:

    functions.php try to find this code and replace it:

    if ( esc_url(of_get_option('slide-image', get_template_directory_uri() . '/images/slide-image/slide-image2.jpg')) != '' || esc_url(of_get_option('extra-image', get_template_directory_uri() . '/images/slide-image/slide-image3.jpg')) != '' || esc_url(of_get_option('extra-imagen', get_template_directory_uri() . '/images/slide-image/slide-image4.jpg'))  != '') :
    	wp_enqueue_script( 'simplify-slider', get_template_directory_uri(). '/js/jqFancyTransitions.1.8.min.js', array( 'jquery' ) );
    	endif;

    that’s it…
    have a nice day.
    And thank you.

Viewing 2 replies - 1 through 2 (of 2 total)