Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #55539
    aezzell
    Member

    Can someone please explain how the “randomize uploaded header” feature is supposed to work?

    I have header images enabled on all the site pages, and my expectation is that randomizing them would select a random image each time a page loads.

    That’s not happening.

    Here’s the site: http://www.uppervalleyfencingclub.com/wp/

    I have 4 possible header images uploaded, and they are listed in the Previously uploaded section. But the same image keeps displaying, and it’s the same on all pages.

    What’s random about this feature? What am I missing?

    Thanks.

    #55542
    aezzell
    Member

    I can’t see how to edit my original post, so let me add this:

    I found out how to assign a different featured image on each page and use that in place of the header image, but that means manually setting the default image on each page.

    Not a big deal in the grander scheme of things, but I’d like to understand how to use the randomize header image feature.

    Thanks!

    #55546
    Sakin
    Keymaster

    @aezzell: This theme doesn’t use random header so instead we added in Different header image option. You can build child theme and add the following code in your child theme functions.php file. For child theme, check out http://catchthemes.com/blog/create-child-theme-wordpress/

    function catchresponsive_featured_overall_image() { 
    	$options				= catchresponsive_get_theme_options();	
    	$header_image 			= get_header_image();
    	
    	if ( $header_image != '' ) { ?>
    		<div id="header-featured-image">
    			<div class="wrapper">
    				<?php 
    				// Header Image Title/Alt
    				if ( !empty( $options[ 'featured_header_image_alt' ] ) ) {
    					$title = esc_attr( $options[ 'featured_header_image_alt' ] ); 	
    				}
    				else {
    					$title = '';
    				}
    
    				// Header Image Link and Target
    				if ( !empty( $options[ 'featured_header_image_url' ] ) ) {
    					$link = esc_url( $options[ 'featured_header_image_url' ] );
    					
    					//Checking Link Target
    					if ( !empty( $options[ 'featured_header_image_base' ] ) )  {
    						$target = '_blank'; 	
    					}
    					else {
    						$target = '_self'; 	
    					}
    				}
    				else {
    					$link = '';
    					$target = '';
    				}
    
    				if ( !empty( $options[ 'featured_header_image_url' ] ) ) {  ?>
    					<a title="<?php echo esc_attr( $title ); ?>" href="<?php echo esc_url( $link ); ?>" target="<?php echo $target; ?>"><img src="<?php header_image(); ?>" alt="<?php echo $title; ?>"></a> 	
    				<?php 
    				}
    				else { ?>
    					<img src="<?php header_image(); ?>" alt="<?php echo $title; ?>">
    				<?php 
    				} ?>
    			</div>
    		</div>
    	<?php 	
    	}
    }
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Randomizing header images’ is closed to new replies.