简体   繁体   中英

How to add image and logo (psd) on wordpress theme (mystile) header?

I believe it goes somewhere here. The website is hosted locally via MAMP. lets say images are:

  • localhost:port/uploads/headerbackground.jpg
  • localhost:port/uploads/logo.psd

how could I add header background and logo on the header?

<body <?php body_class(); ?>>
<?php woo_top(); ?>

<div id="wrapper">



<div id="top">
    <nav class="col-full" role="navigation">
        <?php if ( function_exists( 'has_nav_menu' ) && has_nav_menu( 'top-menu' ) ) { ?>
        <?php wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'top-nav', 'menu_class' => 'nav fl', 'theme_location' => 'top-menu' ) ); ?>
        <?php } ?>
        <?php
            if ( class_exists( 'woocommerce' ) ) {
                echo '<ul class="nav wc-nav">';
                woocommerce_cart_link();
                echo '<li class="checkout"><a href="'.esc_url($woocommerce->cart->get_checkout_url()).'">'.__('Checkout','woothemes').'</a></li>';
                echo get_search_form();
                echo '</ul>';
            }
        ?>
    </nav>
</div><!-- /#top -->



<?php woo_header_before(); ?>

<header id="header" class="col-full">



    <hgroup>

         <?php
            $logo = esc_url( get_template_directory_uri() . '/images/logo.png' );
            if ( isset( $woo_options['woo_logo'] ) && $woo_options['woo_logo'] != '' ) { $logo = $woo_options['woo_logo']; }
            if ( isset( $woo_options['woo_logo'] ) && $woo_options['woo_logo'] != '' && is_ssl() ) { $logo = preg_replace("/^http:/", "https:", $woo_options['woo_logo']); }
        ?>
        <?php if ( ! isset( $woo_options['woo_texttitle'] ) || $woo_options['woo_texttitle'] != 'true' ) { ?>
            <a id="logo" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php esc_attr( get_bloginfo( 'description' ) ); ?>">
                <img src="<?php echo $logo; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" />
            </a>
        <?php } ?>

        <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
        <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
        <h3 class="nav-toggle"><a href="#navigation"><mark class="websymbols">&#178;</mark> <span><?php _e('Navigation', 'woothemes'); ?></span></a></h3>

    </hgroup>

    <?php woo_nav_before(); ?>

In general, I want to do this instead of that Any help would be appreciated.

You can't add a PSD file like that. It's a Photoshop file that needs saving into something like JPG or PNG

Also looks like your Woo theme has that inbuilt functionality so check the settings

For header background image:

Navigate to Appearance > Header within the WordPress administration and check for "Header Image" and then upload your headerBackgroung image.

for PSD:You can't add a PSD for your logo.you can create logo image from psd and then you can upload

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM