I have a theme that I am customizing on WordPress (Increate themes). The thing is that the owner wants a page that talks about something different and it will also have a different logo for this particular page.
My question is: How can I insert a different logo in this page?
I already have a logo in all my webpages, but I want to have 2 different logos:
One for a particular page and another for all the other pages.
This is my theme header.php
:
<div class="headdown <?php echo $sticky_header;?>">
<div class="row clearfix">
<div class="logo">
<a title="<?php bloginfo("description");?>" href="<?php echo home_url();?>">
<?php if ($ht_options['logo_url']) { ?>
<img src="<?php echo $ht_options['logo_url'];?>" alt="<?php bloginfo('description'); ?>"/>
<?php } else { ?>
<img src="<?php echo get_template_directory_uri();?>/images/logo.png" alt="Logo"/>
<?php }?>
</a>
</div>
1) Use this plugin for add image as logo(same like Featured thumbnails). And called based on post id.
Add this code on function.php
/*Logo Image*/
if (class_exists('MultiPostThumbnails')) {
//$types = array('post', 'page');
$types = array('page');
foreach($types as $type) {
new MultiPostThumbnails(array(
'label' => 'Header Banner',
'id' => 'secondary-image',
'post_type' => $type
)
);
}
}
call this value on header.php
$value = MultiPostThumbnails::get_post_thumbnail_url(get_post_type(), 'secondary-image');
2) Create custom options for media select and call meta value on header.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.