WordPress.org

Support

Support » Themes and Templates » How to show different logo on different pages in wordpress theme?

How to show different logo on different pages in wordpress theme?

  • The theme’s header.php code for logo looks like:

    <?php
    		if ($cmsms_option[CMSMS_SHORTNAME . '_text_logo']) {
    			if ($cmsms_option[CMSMS_SHORTNAME . '_text_logo_title'] !== '') {
    				$blog_title = $cmsms_option[CMSMS_SHORTNAME . '_text_logo_title'];
    			} else {
    				$blog_title = (get_bloginfo('name')) ? get_bloginfo('name') : 'Increase';
    			}
    
    			if ($cmsms_option[CMSMS_SHORTNAME . '_text_logo_subtitle_text'] !== '') {
    				$blog_descr = $cmsms_option[CMSMS_SHORTNAME . '_text_logo_subtitle_text'];
    			} else {
    				$blog_descr = (get_bloginfo('description')) ? get_bloginfo('description') : 'Portfolio & Photography';
    			}
    
    			echo '<a href="' . home_url() . '/" title="' . $blog_title . '" class="logo">' . "\n\t" .
    				'<span class="title">' . $blog_title . '</span>' . "\n";
    
    			if ($cmsms_option[CMSMS_SHORTNAME . '_text_logo_subtitle']) {
    				echo '<br />' . "\n" .
    				'<span class="title_text">' . $blog_descr . '</span>' . "\r";
    			}
    
    			echo '</a>';
    		} else {
    			if ($cmsms_option[CMSMS_SHORTNAME . '_logo_url'] === '') {
    				echo '<a href="' . home_url() . '/" title="' . get_bloginfo('name') . '" class="logo">' . "\n\t" .
    					'<img src="' . get_template_directory_uri() . '/img/logo.png" alt="' . get_bloginfo('name') . '" />' . "\r" .
    				'</a>' . "\n";
    			} else {
    				echo '<a href="' . home_url() . '/" title="' . get_bloginfo('name') . '" class="logo">' . "\n\t" .
    					'<img src="' . ((is_numeric($cmsms_option[CMSMS_SHORTNAME . '_logo_url'])) ? array_shift(wp_get_attachment_image_src($cmsms_option[CMSMS_SHORTNAME . '_logo_url'], 'full')) : $cmsms_option[CMSMS_SHORTNAME . '_logo_url']) . '" alt="' . get_bloginfo('name') . '" />' . "\r" .
    				'</a>' . "\n";
    			}
    		}
    	?>

    Any help gratefully accepted!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to show different logo on different pages in wordpress theme?’ is closed to new replies.