WordPress.org

Forums

[resolved] Editing Header.php in Pictorico Theme (4 posts)

  1. jahmin
    Member
    Posted 1 year ago #

    Hi,

    I'm looking for some help on editing the header.php in the Pictorico Theme so as to insert an image in site-branding.div. By default the theme inserts the site name as text. The .php is below, any suggestions on what I need to do would be most welcome!!

    Thanks

    Laurie

    <?php
    /**
     * The Header for our theme.
     *
     * Displays all of the <head> section and everything up till <div id="content">
     *
     * @package Pictorico
     */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php wp_title( '|', true, 'right' ); ?></title>
    <link rel="profile" href="http://gmpg.org/xfn/11">
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    
    <?php wp_head(); ?>
    </head>
    
    <body <?php body_class(); ?>>
    <div id="page" class="hfeed site">
    
    	<header id="masthead" class="site-header" role="banner">
    		<div class="site-header-inner">
    			<div class="site-branding">
    				<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
    				<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
    			</div>
    			<nav id="site-navigation" class="main-navigation" role="navigation">
    				<h1 class="menu-toggle"><span class="screen-reader-text"><?php _e( 'Menu', 'pictorico' ); ?></span></h1>
    				<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'pictorico' ); ?></a>
    
    				<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
    			</nav><!-- #site-navigation -->
    			<div class="header-search">
    				<?php get_search_form(); ?>
    			</div>
    		</div>
    	</header><!-- #masthead -->
    	<?php if ( is_home() && pictorico_has_featured_posts( 1 ) ) : ?>
    		<?php get_template_part( 'content', 'featured' ); ?>
    	<?php elseif ( get_header_image() && ( is_home() || is_archive() || is_search() ) ) : ?>
    		<div class="hentry has-thumbnail">
    			<div class="entry-header">
    				<div class="header-image" style="background-image: url(<?php header_image(); ?>)">
    					<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><span class="screen-reader-text"><?php bloginfo( 'name' ); ?></span></a>
    				</div>
    			</div>
    		</div>
    	<?php endif; ?>
    	<div id="content" class="site-content">
  2. jahmin
    Member
    Posted 1 year ago #

    scratch that, i've sorted it.

  3. elvir79
    Member
    Posted 11 months ago #

    hello
    can you please tell what you did to sort your problem ... i have the same one.

  4. jahmin
    Member
    Posted 11 months ago #

    no problem,

    this is the edited header.php file: here

    the code i changed is in line 27.

    compare that to the header.php file in your pictorico theme.

    you'll need to make your own pictorico child theme to ensure that the change is not undone by a theme update.

Topic Closed

This topic has been closed to new replies.

About this Topic