• I put this in functions.php:

    function superslide_load() {
    		$tdir = 'superheader';
    		$dh  = opendir($tdir);
    		while (false !== ($filename = readdir($dh))) {
    		    $files[] = $filename;
    		}
    
    	        //$dirs = scandir($tdir);
    	        foreach($files as $file) {
    	                if (($file == '.')||($file == '..'))
    	                {
    	                }
    	                elseif (is_dir($tdir.'/'.$file))
    	                {
    	                        filesInDir($tdir.'/'.$file);
    	                }
    	                else
    	                {
    	                      echo  '<div><img src="'. $tdir.'/'.$file.'"/></div>';
    	                }
    	        }
    	}

    I tried calling it (within php tags, in the body of the page.php template) with:

    superslide_load() and also tried:
    <?php if ( function_exists( 'superslide_load' ) ) superslide_load(); ?>

    then I added:
    add_action('wp_head', 'superslide_load');
    to the functions.php (right after the function closed) and tried calling it this way:
    <?php do_action( 'superslide_load', '' ); ?>

    No luck! No errors! Just nothing. Weird because I had this working in MAMP locally (the first sample, above), but can’t make it work on the public server.

    Any clues? Thanks!

Viewing 1 replies (of 1 total)
  • Thread Starter richoid

    (@richoid)

    Another note: I first tried:

    function superslide_load()
    	{	$tdir = 'superheader';
    	        $dirs = scandir($tdir);
    	        foreach($dirs as $file)
    	        {
    	                if (($file == '.')||($file == '..'))
    	                {
    	                }
    	                elseif (is_dir($tdir.'/'.$file))
    	                {
    	                        filesInDir($tdir.'/'.$file);
    	                }
    	                else
    	                {
    	                      echo  '<li><img src="'. $tdir.'/'.$file.'"/></li>';
    	                }
    	        }
    	}

Viewing 1 replies (of 1 total)
  • The topic ‘using functions.php (theme functions)’ is closed to new replies.