• Hi everybody,

    I hope someone can help me with this issue.
    I want to set the homepage featured post slider with automatic sliding and I could get it, putting a littel jquery in function.php.
    Problem is I’d like to have a fading effect.
    And I can’t set the jquery – I’m not so smart with code.
    If somebody can help wiht this – please: don’t tell to use Fourteen Extended I tried it , but I just want to fix a little jquery code in my function.php file…

    So, this is the code I have for auto slider:

    function add_script_in_footer(){
    ?>
    <script type=”text/javascript” charset=”utf-8″>
    jQuery(document).ready(function(){
    var change_every = 5; // The number of seconds that the slider will auto-advance in
    var current = 1;
    function auto_advance(){
    if(current == -1) return false;
    jQuery(‘#featured-content .slider-next’).eq(current % jQuery(‘#featured-content .slider-next’).length).trigger(‘click’, [true]);
    current++;
    };
    setInterval(function(){auto_advance()}, change_every * 1000);
    });
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘add_script_in_footer’);

    ?>

    while, to make a fade slider I should use something like this but can’t adapt…:

    $(function(){
    $(‘.fadein img:gt(0)’).hide();
    setInterval(function(){
    $(‘.fadein :first-child’).fadeOut()
    .next(‘img’).fadeIn()
    .end().appendTo(‘.fadein’);},
    3000);
    });

    Thank-you,

    Lore

  • The topic ‘how to set auto slider with fade’ is closed to new replies.