• Hi, I’m trying to create my first Wp Template but I’m a self-made programmer (it means that my knowledge of PHP and stuff like this is almost 0 😛 ) anyway I almost did everything the only thing I can’t find (and it’s 2 months that I’m googling…) is a good tutorial that teaches me how to add a slideshow (NO PLUGIN) to my new template…

    I would like this slideshow to automagically catch the first image of each post and show so if I click on the image it links to the post…
    No way to find …. is there anyone who can teach me how to do it?
    I placed also a few bids on Fiverr but I had only 2 answers and no one solved my problem!

    Actually to “catch” the first image of each post I use this:

    //A different way to show thumbnails
    function getImage($num) {
    global $more;
    $more = 1;
    $link = get_permalink();
    $title = get_the_title ();
    $content = get_the_content();
    $count = substr_count($content, ‘<img’);
    $start = 0;
    for($i=1;$i<=$count;$i++) {
    $imgBeg = strpos($content, ‘<img’, $start);
    $post = substr($content, $imgBeg);
    $imgEnd = strpos($post, ‘>’);
    $postOutput = substr($post, 0, $imgEnd+1);
    $postOutput = preg_replace(‘/width=”([0-9]*)” height=”([0-9]*)”/’, ‘/width=”50px″ height=”50px″/’,$postOutput);
    $image[$i] = $postOutput;
    $start=$imgEnd+1;
    }
    if(stristr($image[$num],'<img’)) { echo ‘‘.$image[$num].”“; }
    $more = 0;
    }

    Then when I need to show the image I have to write this:
    <?php getImage(‘1’); ?>
    and it works 🙂

    Suggestions? Prays? Blames?
    Could someone please help me?
    Thanks a lot!

    If someone want to take a look to the template I’m creating here is an example: http://test.downloadtaky.info/
    There is a slideshow but it doesn’t work as I wish…
    Thanks once again!

The topic ‘Create a slideshow’ is closed to new replies.