• Resolved Startwebsiting

    (@startwebsiting)


    Hello all,

    I am trying to change the default size of my slider, but it seems that something doesn’t work for me. I did the following:

    – In my child/functions.php file I inserted the following code:

    add_filter( ‘tc_slider_full_size’, ‘my_slider_full_size’);
    function my_slider_full_size() {
    $sizeinfo = array( ‘width’ => 99999 , ‘height’ => 600, ‘crop’ => false );
    return $sizeinfo;
    }

    – After this I used the Regenerate Thumbnails widget to refresh my pictures for the slider.

    Does someone have any idea what could be the problem with this? Do I need to do something else?

    Link to the website: https://www.startwebsiting.com/

    Thank you in advance,

Viewing 7 replies - 1 through 7 (of 7 total)
  • I can see the height is still 500px. Is that all that is wrong? Just a thought, did you change the sizes of the images?

    Thread Starter Startwebsiting

    (@startwebsiting)

    Hello Rdellconsulting,

    Thank you for your replay.

    Yup, the only thing that is wrong is the slider height. I would like to make it 600px, but it seems that it doesn’t accept the code because it is still at 500px.

    What do you mean with changing the sizes of the images? The slide pictures have dimensions of: 1500 × 548.

    Thank you,

    Since its height is smaller than 600px then it will not get resized when you regenerate thumbnails.

    Thread Starter Startwebsiting

    (@startwebsiting)

    Hello d4z_c0nf,

    I am sorry for my late reply.

    I’ve changed the picture size to 1600 x 600px, however it seems that it doesn’t change the default slider height to 600px (the height is still 500px).

    Do you have any other ideas what could be the problem here?

    Thank you,

    The images in your slider all seem to be 1600x500px, not 1600×600. (e.g. here)

    @startwebsiting
    In my opinion the major problem are those in the filter. And you should use or .
    That’s what I get when I use your code (WP_DEBUG enabled , and printing the full width slider sizes):

    Notice: Use of undefined constant ‘tc_slider_full_size’ - assumed '‘tc_slider_full_size’' in xxx/wordpress/wp-content/themes/customizr-child/functions.php on line 1700
    
    Notice: Use of undefined constant ‘my_slider_full_size’ - assumed '‘my_slider_full_size’' in xxx/wordpress/wp-content/themes/customizr-child/functions.php on line 1700
    Array ( [width] => 9999 [height] => 500 [crop] => 1 )

    Now using this code:

    add_filter( 'tc_slider_full_size', 'my_slider_full_size');
    function my_slider_full_size() {
    $sizeinfo = array( 'width' => 99999 , 'height' => 600, 'crop' => false );
    return $sizeinfo;
    }

    Array ( [width] => 99999 [height] => 600 [crop] => )

    So that looks like to be the problem, sorry I didn’t notice it before.
    After that you have to change the css according to the new sizes:
    https://www.themesandco.com/snippet/reduce-height-slider/
    (ok it says “reduce” but it’s the same principle)

    Hope this helps.

    Thread Starter Startwebsiting

    (@startwebsiting)

    @electricfeet

    Thank you for your reply. I don’t know why it shows that the slider height is at 500px, but I guaranty you that the pic has height of 600px. I did the pic on my own with PhotoShop so I am sure it is 600px.

    @d4z_c0nf

    It works ?? that was the issue. Thank you very much again. I will play a bit with the WP_DEBUG so next time I will try to resolve issues of this kind on my own. Thanks! Problem solved.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Chaning the default slider size’ is closed to new replies.