This is website I am working on abraham-accountants.co.uk. However the logo appear on all the web pages but not on the homepage.
This php code I used to add logo in and uploaded logo file to ftp server.
// Display Site Title
add_action( 'smartline_site_title', 'smartline_display_site_title' );
function smartline_display_site_title() { ?>
<div class='my-logo'>
<img src="<?php bloginfo('template_directory');?>/images/AA.gif">
</div>
<a href="<?php echo esc_url(home_url('/')); ?>"
title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"
rel="home">
<h1 class="site-title"><?php bloginfo('name'); ?></h1>
</a>
<?php
}
This was done on template-tag php file for smartline lite theme.
try this code by adding to functions.php in your themes folder,
function my_logo() {
echo '<style type="text/css">
h1 a { background-image:url('.get_bloginfo('template_directory').'/images/your-logo.png) !important; }
</style>';
}
add_action('login_head', 'my_logo');
Related
I am new to wordpress and i have created blog using it.All blogs are on the home page.I have also upload the logo on home page and its visible only on home page so when user click on any of particular blog the logo is not visible there.
<div class="logo">
<?php if ( get_theme_mod('himalayas_logo', '') != '') { ?>
<?php theme_logo(); ?>
<?php } ?>
<?php if (function_exists('the_custom_logo') && has_custom_logo( $blog_id = 0 )) {
himalayas_the_custom_logo();
} ?>
</div>
Remove condition of check option value now code will be:
<div class="logo">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<img src="<?php echo get_template_directory_uri(); ?>/images/logo.png" alt="" />
</a>
</div>
Finally Get answer
revert all code to original modify code just go to
Appreance->Theme->customize->Himalayas Header Options->Header Title/Tagline and Logo->select option "Header Logo Only"
That's it
i am trying to findout, in which php file does the below exists.
Reason, the href does not work on the logo1.png. in my below code.
<div class="site-branding">
<h1 class="site-title">IRONWARE</h1>
<p class="site-description">Home Products..</p>
</div>
stylesheet:
.site-branding {
content: url("http://ironware.in/wp-content/uploads/2015/07/Logo1.png");
width: 35% !important;
Now to find, by browser > right click > Inspect element > in which PHP does the exists ?
I found the solution by adding the below to my childs theme's header.php
add_action( 'init', 'storefront_custom_logo' );
function storefront_custom_logo() {
remove_action( 'storefront_header', 'storefront_site_branding', 20 );
add_action( 'storefront_header', 'storefront_display_custom_logo', 20 );
}
function storefront_display_custom_logo() {
?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="site-logo-link" rel="home">
<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png" alt="<?php echo get_bloginfo( 'name' ); ?>" />
</a>
<?php
}
I’ve got a WordPress site and have added the following code to the Single.php file, which means if I publish a blog post without selecting a ‘Featured Image’, it will display a default ‘Featuered Image’ instead (tellymedia-temporary-image.jpg).
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else { ?>
<img src="<?php bloginfo('template_directory'); ?>/branding/tellymedia-temporary-image.jpg" alt="<?php the_title(); ?>" />
This works fine on the actual page displaying the individual blog post (which shows the default image), but I’m also using the following code in my Functions.php file, to display a ‘Featured Image’ thumbnail for each post in the Sidebar:
<span class="widget-listing-thumbnail"><?php the_post_thumbnail(); ?></span><?php get_the_title() ? the_title()+the_subtitle('<span class="widget-subtitle">', '</span class="widget-subtitle">') : the_ID(); ?>
While this works for all other posts it doesn’t work for any where I haven’t selected a ‘Featued Image’. Is there a way to tweak the code in my Functions.php file please, so it will also display a thumbnail of the default ‘Featuered Image’ in the Sidebar for posts where I haven’t selected one please?
Thanks!
try this one.
<a href="<?php the_permalink(get_the_id()); ?>">
<span class="widget-listing-thumbnail">
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else { ?>
<img src="<?php bloginfo('template_directory'); ?>/branding/tellymedia-temporary-image.jpg" alt="<?php the_title(); ?>" />
?>
</span>
<?php get_the_title() ? the_title() + the_subtitle('<span class="widget-subtitle">', '</span class="widget-subtitle">') : the_ID(); ?>
</a>
I'm a front-end web developer struggling with some theme option support. I am struggling to write a simple function in my header.php which allows me to do the following:
"if user uploads an image, use the image. If else use 'logo_text' and echo output. If user doesnt upload image or logo_text use default of 'My Site'"
Can anyone point me in the right direction to get started? I don't know where to begin for this one.
<li class="name">
<!-- Logo Text -->
<h1><a href="<?php bloginfo('url'); ?>/home" title="<? echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<? $novus_logo_text = get_option('novus_logo_text'); echo $novus_logo_text; ?>
</a></h1>
<!-- Logo Image -->
<a href="<?php bloginfo('url'); ?>/home" title="<? echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<? $novus_logo_upload = get_option('novus_logo_upload'); echo '<img class=\"logo"\ src="'.$novus_logo_upload.'" width=\"100%"\ />'; ?>
</a>
</li>
The code above works just fine. However if a client uses both the logo_text input and uploads a logo image they will both output. I need either or, with the image taking priority. I hope this makes sense.
You should really learn basic control structures even if your a front end guy, if, while, for, foreach, switch.
<li class="name">
<?php if($novus_logo_upload = get_option('novus_logo_upload')){ ?>
<!-- Logo Image -->
<a href="<?php bloginfo('url'); ?>/home" title="<? echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<? echo '<img class=\"logo"\ src="'.$novus_logo_upload.'" width=\"100%"\ />'; ?>
</a>
<?php } else if($novus_logo_text = get_option('novus_logo_text')){ ?>
<!-- Logo Text -->
<h1><a href="<?php bloginfo('url'); ?>/home" title="<? echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<? echo $novus_logo_text; ?>
</a></h1>
<?php } else { ?>
<!-- Default -->
<?php } ?>
</li>
I have this wordpress template: http://bluth.is/wordpress/bliss/
and I want to change the header. The subtitle should be UNDER the logo and not next to it. I have tried to make the content bigger and the logo smaller but nothing works. Any ideas?
The Code from the header.php:
<div class="span9" style="height:90px;">
<p>
<a class="brand brand-image" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo $logo; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"><?php if(!of_get_option('disable_description')){ ?></a>
</p>
<small><?php bloginfo( 'description' ); ?></small></div><?php } ?>
Using CSS margin you can move it wherever you want.
I don't know exactly the using pixles but here is how it suppose to be:
margin: 30px -100px 0;
Ofcourse there is a better way using photoshop to edit the logo and add him this subtitle.