• Resolved hopelesstechie

    (@hopelesstechie)


    Hello everyone!

    I am begging for help. I want to change my blog title to a logo but can’t for the life of me figure it out. I have been online for about 6 hours reading similar threads up and down the net to no avail. I understand that I need to change a particular line of code in the header.php folder, but the problem is when I find a suggestion that says to replace x code with y code, I can never find that exact line of code in my folder. Also, sometimes I’ll see lines of code that appear to be similar to others and I never know which one is the right one to replace. It’s like diffusing a bomb. Do I cut the red wire or the blue wire?

    So if anyone can please tell me exactly which code to replace with what replacement text, I would really appreciate it.

    Here’s my blog: thewritepost.com

    And this is the complete code found in my header.php folder: https://pastebin.com/gxgwprrw#

Viewing 8 replies - 1 through 8 (of 8 total)
  • try this:

    replace the following code with your header.php code, and don’t forget to add the link of the logo instead of “LINK GOES HERE” in the code:

    <?php global $smof_data; ?>
    <!doctype html>
    <html <?php language_attributes(); ?>>
    <head>
    
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
            <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
            <meta charset="<?php bloginfo('charset'); ?>">
            <meta name="viewport" content="width=device-width, initial-scale=1.0" />
            <title><?php wp_title('|',true,'right'); ?><?php bloginfo('name'); ?></title>
            <meta name="generator" content="Inspirin Theme By FameThemes" />
            <?php if(!empty($smof_data['ft_favicon'])): ?><link rel="shortcut icon" href="<?php echo esc_url($smof_data['ft_favicon']); ?>" type="image/x-icon" /><?php endif; ?>
            <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
            <link rel="apple-touch-icon" href="<?php echo get_template_directory_uri(); ?>/images/apple-touch-icon.png" />
            <?php wp_head(); ?>
    
    </head>
    
    <body <?php body_class(); ?>>
    
    <header id="header">
            <div class="wrapper clearfix">
                    <div class="ft-lheader">
                            <a class="ft-jpbutton" href="#menu"><i class="icon-reorder"></i></a>
                            <div class="ft-logo">
                                    <div class="ct-logo">
    				<img src="LINK GOES HERE" />
    				</div>
                            </div>
                    </div>
                    <div class="ft-rheader">
                            <div class="ft-menu">
                                    <?php if ( has_nav_menu( 'primary_navigation' ) ): ?>
                                    <?php wp_nav_menu( array('theme_location' => 'primary_navigation','container' => false,'menu_class' => 'primenu','echo' => true,'before' => '','after' => '','link_before' => '','link_after' => '','depth' => 3,'items_wrap' => '<ul class="primenu">%3$s</ul>')); ?>
                                    <?php else: ?>
                                    <p class="ft-nomenus">Please Setup Your Menus : Dashboard -> Appearance -> Menus</p>
                                    <?php endif; ?>
                            </div>
                            <div class="ft-icons">
                                    <ul>
                                            <?php if(!empty($smof_data['ft_rss'])): ?><li class="ft-rss"><a target="_blank" href="<?php echo esc_url($smof_data['ft_rss']); ?>"><i class="icon-rss"></i></a></li><?php endif; ?>
                                            <?php if(!empty($smof_data['ft_twitter'])): ?><li class="ft-twitter"><a target="_blank" href="https://twitter.com/<?php echo esc_attr($smof_data['ft_twitter']); ?>"><i class="icon-twitter"></i></a></li><?php endif; ?>
                                            <?php if(!empty($smof_data['ft_facebook'])): ?><li class="ft-facebook"><a target="_blank" href="<?php echo esc_url($smof_data['ft_facebook']); ?>"><i class="icon-facebook"></i></a></li><?php endif; ?>
                                            <?php if(!empty($smof_data['ft_google_plus'])): ?><li class="ft-google"><a target="_blank" href="<?php echo esc_url($smof_data['ft_google_plus']); ?>"><i class="icon-google-plus"></i></a></li><?php endif; ?>
                                            <li><a class="search-bt" href="#"><i class="icon-search"></i></a></li>
                                    </ul>
                                    <div class="ft-search-hide"><?php get_search_form( true ); ?><div class="ft-shbg"></div></div>
                            </div>
                    </div>
            </div>
    </header>
    
    <div class="container">
    Thread Starter hopelesstechie

    (@hopelesstechie)

    OMG! Thank You!!!

    It worked like a charm! You don’t know how happy you made me tonight.

    Thanks again ??

    Thread Starter hopelesstechie

    (@hopelesstechie)

    Topic resolved.

    You welcome, it’s my pleasure. ??

    You may also add the link of your website on the image so when the user click on the logo he will be redirected to the home page.

    edit the following section in the code:

    <div class="ct-logo">
    <a href="https://www.thewritepost.com/" title="The Write Post">
    				<img src="LINK GOES HERE" alt="The Write Post" />
    </a>
    				</div>
    Thread Starter hopelesstechie

    (@hopelesstechie)

    I just dropped in the code and it works great.

    Thanks again :))

    No need ??

    Sorry to drop in on this post, but Mohammad, is there any chance you could help me out with replacing the blog name with a logo?

    I’m using the TwentyTen with a child theme called Sawojajar that has it’s own header.php file. The code is below.

    <?php
    /**
    * The Header for our theme.
    *
    * Displays all of the <head> section and everything up till <div id=”main”>
    *
    * @package WordPress
    * @subpackage Twenty_Ten
    * @since Twenty Ten 1.0
    */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
    <title><?php
    /*
    * Print the <title> tag based on what is being viewed.
    */
    global $page, $paged;

    wp_title( ‘|’, true, ‘right’ );

    // Add the blog name.
    bloginfo( ‘name’ );

    // Add the blog description for the home/front page.
    $site_description = get_bloginfo( ‘description’, ‘display’ );
    if ( $site_description && ( is_home() || is_front_page() ) )
    echo ” | $site_description”;

    // Add a page number if necessary:
    if ( $paged >= 2 || $page >= 2 )
    echo ‘ | ‘ . sprintf( __( ‘Page %s’, ‘twentyten’ ), max( $paged, $page ) );

    ?></title>
    <link rel=”profile” href=”https://gmpg.org/xfn/11&#8243; />
    <link rel=”stylesheet” type=”text/css” media=”all” href=”<?php bloginfo( ‘stylesheet_url’ ); ?>” />
    <link rel=”pingback” href=”<?php bloginfo( ‘pingback_url’ ); ?>” />
    <?php
    /* We add some JavaScript to pages with the comment form
    * to support sites with threaded comments (when in use).
    */
    if ( is_singular() && get_option( ‘thread_comments’ ) )
    wp_enqueue_script( ‘comment-reply’ );

    /* Always have wp_head() just before the closing </head>
    * tag of your theme, or you will break many plugins, which
    * generally use this hook to add elements to <head> such
    * as styles, scripts, and meta tags.
    */
    wp_head();
    ?>
    </head>

    <body <?php body_class(); ?>>
    <div id=”wrapper” class=”hfeed”>
    <div id=”header”>
    <div id=”masthead”>
    <div id=”branding” role=”banner”>
    <?php $heading_tag = ( is_home() || is_front_page() ) ? ‘h1’ : ‘div’; ?>
    <<?php echo $heading_tag; ?> id=”site-title”>
    <span>
    ” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?>
    </span>
    </<?php echo $heading_tag; ?>>
    <div id=”site-description”><?php bloginfo( ‘description’ ); ?></div>
    <div id=”access” role=”navigation”>
    <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    <div class=”skip-link screen-reader-text”>“><?php _e( ‘Skip to content’, ‘twentyten’ ); ?></div>
    <?php /* Our navigation menu. If one isn’t filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
    <?php wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘theme_location’ => ‘primary’ ) ); ?>
    </div><!– #access –>
    <?php
    // Check if this is a post or page, if it has a thumbnail, and if it’s a big one
    if ( is_singular() && current_theme_supports( ‘post-thumbnails’ ) &&
    has_post_thumbnail( $post->ID ) &&
    ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘post-thumbnail’ ) ) &&
    $image[1] >= HEADER_IMAGE_WIDTH ) :
    // Houston, we have a new header image!
    echo get_the_post_thumbnail( $post->ID );
    elseif ( get_header_image() ) : ?>
    <img src=”<?php header_image(); ?>” width=”<?php echo HEADER_IMAGE_WIDTH; ?>” height=”<?php echo HEADER_IMAGE_HEIGHT; ?>” alt=”” />
    <?php endif; ?>
    </div><!– #branding –>

    </div><!– #masthead –>
    </div><!– #header –>

    <div id=”main”>

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Desperate to understand header.php folder!’ is closed to new replies.