• Resolved OandA Webmistress

    (@oanda-webmistress)


    I would like to have more than 3 pictures in the slider of my main page. I don’t see that as an option. Can you suggest how I can do this while keeping this nice theme?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello @OandA Webmistress,
    Just some few steps and you will be able to achieve it. Suppose if you want to add one more section for slider then:

    1. Go to ‘\accesspress-basic\inc\admin-panel\theme-options.php’:
    add this at line 885:

    if(isset($input['slide5'])){
                $apbasic_inputs['slide5'] = esc_url_raw($input['slide5']);
            }

    2. Add this at line 889: $apbasic_inputs['slide5_title'] = wp_kses_post($input['slide5_title']);

    3. add this at line 906: $apbasic_inputs['slide5_description'] = wp_kses_post($input['slide5_description'],$al_tags);

    4. aadd this at line 913: $apbasic_inputs['slide5_readmore_text'] = sanitize_text_field($input['slide5_readmore_text']);

    5. add this at line 920: $apbasic_inputs['slide5_readmore_button_icon'] = sanitize_text_field($input['slide5_readmore_button_icon']);

    6. change the value of $i <= 4 to $i <= 5 at line 604.

    7. After that open file ‘accesspress-basic\inc\extras.php‘:
    change the value of $i <= 4 to $i <= 5 at line 79.

    8. After that open file \accesspress-basic\inc\admin-panel\js\media-uploader_bkup.js and paste this line at line 115:

    $('#slide5_upload_btn').click(function(e) {
    		e.preventDefault();
    		var image = wp.media({
    			title: 'Upload Image',
    			// mutiple: true if you want to upload multiple files at once
    			multiple: false
    		}).open()
    		.on('select', function(e){
    			// This will return the selected image from the Media Uploader, the result is an object
    			var uploaded_image = image.state().get('selection').first();
    			// We convert uploaded_image to a JSON object to make accessing it easier
    			// Output to the console uploaded_image
    			console.log(uploaded_image);
    			var image_url = uploaded_image.toJSON().url;
    			// Let's assign the url value to the input field
    			$('#slide5').val(image_url);
    		});
    	});

    That is it. Follow similar process for adding more section for slider. Make value of $i to number of slides you want like i have made 5 for 5 slides. And similarly copy paste the codes and modify the codes.

    If you have any query on this, kindly post it.
    Thanks!

    Thread Starter OandA Webmistress

    (@oanda-webmistress)

    I am so excited to find out more slides is possible. I was back at my WP volunteer job today and tried to work on adding more slides. I changed the 3 files, theme-options.php, extras.php, and media-uploader_bkup.js, as instructed, looking for everyplace where slide4 was mentioned and adding slide5. When I login to my WP as admin, Appearance, Theme Options, Slider Settings, I still see only 4 slides. Any thoughts on what to do next?

    Thread Starter OandA Webmistress

    (@oanda-webmistress)

    I had missed a line. It works like a charm now. I am using 7 slides.

    Thread Starter OandA Webmistress

    (@oanda-webmistress)

    Is there a way to do this in a child theme? Or will I have to update the same 3 files every time the Theme has a new release?

    Theme Author Access Keys

    (@access-keys)

    Hi there.

    Thank you for writing in.

    We apologize for our late response.

    If you have used the code in child theme then the update version wont affect your theme.

    But if you have used it in theme then the update version will affect it.

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘more pictures to slider’ is closed to new replies.