• Rezolvat UrsanCristian

    (@ursancristian)



    Salut, dupa cum am precizat si in celalalt topic sunt incepator deci nu ma prea descurc la wp.
    Am vrut sa adaug un header in partea stanga , un logo insa m-am chinuit si nu gasesc nici cum o metoda.Ideea e ca tot ce am eu in fisierul header e diferit fata de tutorialele de pe net.Daca e nevoie postez aici liniile care „cred eu” trebuie modificate cu adresa imaginii uploadate.

    Sau eventual lasati un link care ma poate ajuta.
    Desi stiu ca nu e un lucru foarte greu, m-a pus in dificultate,va multumesc.

Vizualizare 4 răspunsuri - 1 la 4 (din 4 în total)
  • Moderator jnhghy

    (@jnhghy)

    Posteaza te rog codul din header.

    UrsanCristian

    (@ursancristian)

    <?php
    
    /**
    
     * Theme Header Section for our theme.
    
     *
    
     * Displays all of the <head> section and everything up till <div id="main" class="clearfix"> <div class="inner-wrap">
    
     *
    
     * @package ThemeGrill
    
     * @subpackage ColorMag
    
     * @since ColorMag 1.0
    
     */
    
    ?><!DOCTYPE html>
    
    <html <?php language_attributes(); ?>>
    
    <head>
    
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <link rel="profile" href="http://gmpg.org/xfn/11" />
    
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    
    <?php
    
    /**
    
     * This hook is important for wordpress plugins and other many things
    
     */
    
    wp_head();
    
    ?>
    
    </head>
    
    <body <?php body_class(); ?>>
    
    <?php	do_action( 'colormag_before' ); ?>
    
    <div id="page" class="hfeed site">
    
    	<?php do_action( 'colormag_before_header' ); ?>
    
    	<header id="masthead" class="site-header clearfix">
    
    		<div id="header-text-nav-container" class="clearfix">
    
             <?php if ( get_theme_mod( 'colormag_breaking_news', 0 ) == 1 || get_theme_mod( 'colormag_date_display', 0 ) == 1 || get_theme_mod( 'colormag_social_link_activate', 0 ) == 1 ) : ?>
    
                <div class="news-bar">
    
                   <div class="inner-wrap clearfix">
    
                      <?php if (get_theme_mod('colormag_date_display', 0) == 1)
    
                         colormag_date_display();
    
                      ?>
    
                      <?php if (get_theme_mod('colormag_breaking_news', 0) == 1)
    
                         colormag_breaking_news();
    
                      ?>
    
                      <?php if( get_theme_mod( 'colormag_social_link_activate', 0 ) == 1 ) { colormag_social_links(); } ?>
    
                   </div>
    
                </div>
    
             <?php endif; ?>
    
    			<?php if (get_theme_mod('colormag_header_image_position', 'position_two') == 'position_one') { colormag_render_header_image(); } ?>
    
    			<div class="inner-wrap">
    
    				<div id="header-text-nav-wrap" class="clearfix">
    
    					<div id="header-left-section">
    
    						<?php
    
    						if((get_theme_mod('colormag_header_logo_placement', 'header_text_only') == 'show_both' || get_theme_mod('colormag_header_logo_placement', 'header_text_only') == 'header_logo_only') && get_theme_mod('colormag_logo', '') != '') {
    
    						?>
    
    							<div id="header-logo-image">
    
    								<a>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo esc_url(get_theme_mod('colormag_logo')); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"></a>
    
    							</div><!-- #header-logo-image -->
    
    						<?php
    
    						}
    
    						if(get_theme_mod('colormag_header_logo_placement', 'header_text_only') == 'show_both' || get_theme_mod('colormag_header_logo_placement', 'header_text_only') == 'header_text_only') {
    
    						?>
    
    						<div id="header-text">
    
    							<h1 id="site-title">
    
    								<a>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
    
    							</h1>
    
    							<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2><!-- #site-description -->
    
    						</div><!-- #header-text -->
    
    						<?php
    
    						}
    
    						?>
    
    					</div><!-- #header-left-section -->
    
    					<div id="header-right-section">
    
    						<?php
    
    						if( is_active_sidebar( 'colormag_header_sidebar' ) ) {
    
    						?>
    
    						<div id="header-right-sidebar" class="clearfix">
    
    						<?php
    
    							// Calling the header sidebar if it exists.
    
    							if ( !dynamic_sidebar( 'colormag_header_sidebar' ) ):
    
    							endif;
    
    						?>
    
    						</div>
    
    						<?php
    
    						}
    
    						?>
    
    			    	</div><!-- #header-right-section -->
    
    			   </div><!-- #header-text-nav-wrap -->
    
    			</div><!-- .inner-wrap -->
    
    			<?php if( get_theme_mod( 'colormag_header_image_position', 'position_two' ) == 'position_two' ) { colormag_render_header_image(); } ?>
    
    			<nav id="site-navigation" class="main-navigation clearfix" role="navigation">
    
    				<div class="inner-wrap clearfix">
    
    					<?php
    
                   if ( get_theme_mod( 'colormag_home_icon_display', 0 ) == 1 ) {
    
                      if ( is_front_page() ) {
    
                         $home_icon_class = 'home-icon front_page_on';
    
                      } else {
    
                         $home_icon_class = 'home-icon';
    
                      }
    
                      ?>
    
                      <div class="<?php echo $home_icon_class; ?>">
    
                         <a>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"><i class="fa fa-home"></i></a>
    
                      </div>
    
                      <?php
    
                   }
    
                   ?>
    
                   <h4 class="menu-toggle"></h4>
    
                   <?php
    
                   if ( has_nav_menu( 'primary' ) ) {
    
                      wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'menu-primary-container', 'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s' ) );
    
                   }
    
    					else {
    
    						wp_page_menu();
    
    					}
    
    					?>
    
                   <?php if ( get_theme_mod( 'colormag_random_post_in_menu', 0 ) == 1 ) { ?>
    
                      <?php colormag_random_post(); ?>
    
                   <?php } ?>
    
                   <?php if ( get_theme_mod( 'colormag_search_icon_in_menu', 0 ) == 1 ) { ?>
    
                      <i class="fa fa-search search-top"></i>
    
                      <div class="search-form-top">
    
                         <?php get_search_form(); ?>
    
                      </div>
    
                   <?php } ?>
    
    				</div>
    
    			</nav>
    
    		</div><!-- #header-text-nav-container -->
    
    		<?php if( get_theme_mod( 'colormag_header_image_position', 'position_two' ) == 'position_three' ) { colormag_render_header_image(); } ?>
    
    	</header>
    
    	<?php do_action( 'colormag_after_header' ); ?>
    
    	<?php do_action( 'colormag_before_main' ); ?>
    
    	<div id="main" class="clearfix">
    
    		<div class="inner-wrap clearfix">
    Moderator jnhghy

    (@jnhghy)

    Dupa cum observ tema are optiune pentru logo, aici:
    http://themegrill.com/theme-instruction/colormag/#add-custom-logo

    nu cred ca e necesar sa schimbi codul temei dar daca totusi vrei sa o faci, asigura-te ca lucrezi pe un child-theme (tema copil) – poti crea teme copil cu ajutorul unui modul – iar codul care te-ar interesa este:

    <?php
    if((get_theme_mod('colormag_header_logo_placement', 'header_text_only') == 'show_both' || get_theme_mod('colormag_header_logo_placement', 'header_text_only') == 'header_logo_only') && get_theme_mod('colormag_logo', '') != '') {
    ?>
        <div id="header-logo-image">
    	<a>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo esc_url(get_theme_mod('colormag_logo')); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"></a>
        </div><!-- #header-logo-image -->
    <?php
    }

    *foloseste functiile de cautare pentru a gasi partea asta de cod

    Dinnou tin sa mentionez ca problema ta pare rezolvabila cu ajutorul optiunilor si al setarilor. Mai multe informatii in documentatia temei aici:
    http://themegrill.com/theme-instruction/colormag/

    si in special aici:
    http://themegrill.com/theme-instruction/colormag/#header-logo-display-type

    UrsanCristian

    (@ursancristian)

    Multumesc frumos, am rezolvat:).

Vizualizare 4 răspunsuri - 1 la 4 (din 4 în total)
  • Subiectul ‘Adaugare logo’ este închis pentru noi răspunsuri.