Support » Fixing WordPress » img src isn't working in my header.php, trying to get a slideshow

  • hey guys, i’m trying to build a slideshow on my wordpress page using the header.php but none of the <img src=”url”> is working on my homepage at all?

    this is below my navigation on my header.php page:

    <!-- slideshow -->
    <script type="text/javascript">
        Simple jQuery Slideshow Script
        Released by Jon Raasch ( under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
    function slideSwitch() {
        var $active = $('#slideshow');
        if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
        // use this to pull the images in the order they appear in the markup
        var $next =  $ ? $
            : $('#slideshow IMG:first');
        // uncomment the 3 lines below to pull the images in random order
        // var $sibs  = $active.siblings();
        // var rndNum = Math.floor(Math.random() * $sibs.length );
        // var $next  = $( $sibs[ rndNum ] );
        $next.css({opacity: 0.0})
            .animate({opacity: 1.0}, 1000, function() {
                $active.removeClass('active last-active');
    $(function() {
        setInterval( "slideSwitch()", 5000 );
    <img src="slideshow1.png">
    			<div id="frontpageslideshow">
        			 <img src="/themepics/slideshow1.png" alt="" class="active" />
        			 <img src="/themepics/slideshow/slideshow2.jpg" alt="" />
    			</div><!-- end slideshow -->
    <img src="nav-bg.png" style="height:100%;width:100%;">

    and then here’s the matching css:

    #frontpageslideshow {
    #frontpageslideshow IMG {
    #frontpageslideshow {
    #frontpageslideshow IMG.last-active {

    and my images are located here:

    i tried to test images overall and i couldn’t even put in images anywhere on my header.php file at all.

    i took the slideshow code from this tutorial because i’m going for a certain look..this one is very simple and all i need:

    but does anyone know why even the img src tag isn’t working? i tried multiple images in different directories, even the same directory, and i even tried linking images outside of my site from the internet and the img src code still wasn’t working.

    what is the deal?

Viewing 2 replies - 1 through 2 (of 2 total)
  • <img src="<?php echo get_stylesheet_directory_uri() ?>/slideshow/slideshow1.png" alt="first image">
    this should work. Just change every image path you need, but you have to echo stylesheet directory, than folder that contains images, and then image name. Hope that helps. 🙂

    yes ZEX, that fixed it man… thanks bro. these damn wordpress functions driving me crazy… lol

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘img src isn't working in my header.php, trying to get a slideshow’ is closed to new replies.