Jump to content

Recommended Posts

Hi, I'm new to this forum and I'm Italian, so I'm so sorry for my bad English.

 

Anyway, I need some help with header of my blog, I hope someone can help me! I'm not an expert of php

 

I bought a new theme for my blog (the developer doesn't help with code), and I found this problem: logo has a fixed width, I have to change it to have a bigger logo, and to put an ads on the right.

The code is below, the theme can be viewed at this url http://www.industrialthemes.com/engine/

 

Any help or suggestions are accepted. Thanks in advance!

<?php
$postid = isset($post) ? $post->ID : '';
#theme options
$logo_url=it_get_setting('logo_url');
$logo_url_hd=it_get_setting('logo_url_hd');
$logo_width=it_get_setting('logo_width');
$logo_height=it_get_setting('logo_height');
$logo_color_disable=it_get_setting('logo_color_disable');
$link_url=home_url();
$dimensions = '';
$tagline_disable = true;
if(!it_get_setting('description_disable') && get_bloginfo('description')!=='') $tagline_disable = false;

#category specific logo
$category_id = it_page_in_category($postid);
if($category_id) {
	$categories = it_get_setting('categories');	 
	foreach($categories as $category) {
		if(is_array($category)) {
			if(array_key_exists('id',$category)) {
				if($category['id'] == $category_id) {
					if(!empty($category['logo'])) $logo_url=$category['logo'];
					if(!empty($category['logohd'])) $logo_url_hd=$category['logohd'];
					if(!empty($category['logowidth'])) $logo_width=$category['logowidth'];
					if(!empty($category['logoheight'])) $logo_height=$category['logoheight'];
					if(array_key_exists('tagline_disable',$category)) {
						if($category['tagline_disable']) $tagline_disable = true;
					}
					break;
				}
			}
		}
	}
}
if(!empty($logo_width)) $dimensions .= ' width="'.$logo_width.'"';
if(!empty($logo_height)) $dimensions .= ' height="'.$logo_height.'"';

$termargs = array('num' => 7, 'tax' => array('post_tag','category'));

?>

<?php if (!it_component_disabled('header', $postid)) { ?>

	<div class="container-fluid no-padding">
   
        <div id="header-bar">
            
            <div class="row"> 
            
                <div class="col-md-12"> 
                    
                    <div id="header-inner" class="container-inner">
                    
                    	<?php echo it_background_ad(); #full screen background ad ?>
                        
						<?php if(!it_component_disabled('logo', $postid)) { ?>
                        
                            <div id="logo"<?php if($logo_color_disable) { ?> class="no-color"<?php } ?>>
                
                                <?php if(it_get_setting('display_logo') && $logo_url!='') { ?>
                                    <a href="<?php echo $link_url; ?>/">
                                        <img id="site-logo" alt="<?php bloginfo('name'); ?>" src="<?php echo $logo_url; ?>"<?php echo $dimensions; ?> />   
                                        <img id="site-logo-hd" alt="<?php bloginfo('name'); ?>" src="<?php echo $logo_url_hd; ?>"<?php echo $dimensions; ?> />  
                                    </a>
                                <?php } else { ?>     
                                    <h1><a class="textfill" href="<?php echo $link_url; ?>/"><?php bloginfo('name'); ?></a></h1>
                                <?php } ?>
                                
                                <?php if(!$tagline_disable) { ?>
                                
                                    <div class="subtitle"><?php bloginfo('description'); ?></div>
                                    
                                <?php } ?>
                                
                            </div>
                            
                        <?php } ?> 
                        
                        <?php if(!it_component_disabled('header_posts', $postid)) { ?>
                        
                        	<div id="header-posts">
                            
                            	<div align="center"> SOMETHING IS CHANGING!!!  <br /> TESTING <br /></div>
                            
                            </div>
                        
                        <?php } ?>
                        
                        <?php if(!it_component_disabled('header_terms', $postid)) { ?>
                        
                        	<?php $terms = it_get_trending_terms($termargs); ?>
                        
                        	<div id="header-terms">
                            
                            	<div class="shadowed">
                            
                                <div class="term-panel first"><span class="theme-icon-flame"></span><span class="trending-label"><?php _e('TRENDING',IT_TEXTDOMAIN); ?></span></div>
                                    
                                    <?php 
									$i = 0;
									foreach($terms as $term) { 
										$i++; 
										$cssalt = ($i % 2 == 0) ? '' : ' alt'; 
										?>
                                    
                                    	<div class="term-panel<?php echo $cssalt; ?>">
                                        
                                    		<a href="<?php echo get_term_link($term); ?>"><?php echo $term->name; ?></a>
                                            
                                        </div>
                                    
                                    <?php } ?>
                                    
                               </div>
                            
                            </div>
                        
                        <?php } ?>
                    
                    </div>
                    
                </div>
                
            </div>
            
        </div>
        
    </div>
    
<?php } ?>
Link to comment
https://forums.phpfreaks.com/topic/294480-wordpress-header-help/
Share on other sites

It looks like there's a setting panel somewhere that allows you to set the height and width of the logo image? (I'm basing this off the calls to it_get_setting() using 'logo_width' and 'logo_height').

 

If this isn't actually what's happening, you should be able to override the sizing of the image via CSS like this:

#site-logo,
#site-logo-hd{
	width:150px !important;
	height:150px !important;
}
  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.