Tagged: Header
- This topic has 19 replies, 9 voices, and was last updated 10 years, 8 months ago by Theme Horse Support Team.
-
AuthorPosts
-
February 23, 2014 at 5:38 am #8004RiouParticipant
Hello?
February 23, 2014 at 6:12 am #8006stefanovd85MemberRiou, if it helps, I was only able to add this fiction with the parent theme. I was never able to get the child theme to work.
February 24, 2014 at 6:21 am #8046Sanjip ShahParticipant@Riou I repeated this and it is working fine. I have pasted the code of functions.php file
<?php add_action( 'init', 'attitude_remove_parent_function' ); /** * Removes parent function attached to hook */ function attitude_remove_parent_function(){ remove_action( 'attitude_header', 'attitude_child_headerdetails', 10 ); } add_action( 'attitude_header', 'attitude_child_headerdetails', 10 ); /** * Shows Header Part Content * * Shows the site logo, title, description, searchbar, social icons etc. */ function attitude_child_headerdetails() { ?> <?php global $attitude_theme_options_settings; $options = $attitude_theme_options_settings; $elements = array(); $elements = array( $options[ 'social_facebook' ], $options[ 'social_twitter' ], $options[ 'social_googleplus' ], $options[ 'social_linkedin' ], $options[ 'social_pinterest' ], $options[ 'social_youtube' ], $options[ 'social_vimeo' ], $options[ 'social_flickr' ], $options[ 'social_tumblr' ], $options[ 'social_myspace' ], $options[ 'social_rss' ] ); $flag = 0; if( !empty( $elements ) ) { foreach( $elements as $option) { if( !empty( $option ) ) { $flag = 1; } else { $flag = 0; } if( 1 == $flag ) { break; } } } ?> <div class="container clearfix"> <div class="hgroup-wrap clearfix"> <a class="telnumber" href="tel:240-415-8323">Call Now: 240-415-8323</a> <?php if( 0 == $options[ 'hide_header_searchform' ] || 1 == $flag ) { ?> <section class="hgroup-right"> <?php attitude_socialnetworks( $flag ); ?> <?php if( 0 == $options[ 'hide_header_searchform' ] ) get_search_form(); ?> </section><!-- .hgroup-right --> <?php } ?> <hgroup id="site-logo" class="clearfix"> <?php if( $options[ 'header_show' ] != 'disable-both' && $options[ 'header_show' ] == 'header-text' ) { ?> <h1 id="site-title"> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"> <?php bloginfo( 'name' ); ?> </a> </h1> <h2 id="site-description"><?php bloginfo( 'description' ); ?></h2> <?php } elseif( $options[ 'header_show' ] != 'disable-both' && $options[ 'header_show' ] == 'header-logo' ) { ?> <h1 id="site-title"> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"> <img src="<?php echo $options[ 'header_logo' ]; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"> </a> </h1> <?php } ?> </hgroup><!-- #site-logo --> </div><!-- .hgroup-wrap --> </div><!-- .container --> <?php $header_image = get_header_image(); if( !empty( $header_image ) ) :?> <img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"> <?php endif; ?> <?php if ( has_nav_menu( 'primary' ) ) { $args = array( 'theme_location' => 'primary', 'container' => '', 'items_wrap' => '<ul class="root">%3$s</ul>' ); echo '<nav id="access" class="clearfix"> <div class="container clearfix">'; wp_nav_menu( $args ); echo '</div><!-- .container --> </nav><!-- #access -->'; } else { echo '<nav id="access" class="clearfix"> <div class="container clearfix">'; wp_page_menu( array( 'menu_class' => 'root' ) ); echo '</div><!-- .container --> </nav><!-- #access -->'; } ?> <?php if( 'above-slider' == $options[ 'slogan_position' ] && ( is_home() || is_front_page() ) ) if( function_exists( 'attitude_home_slogan' ) ) attitude_home_slogan(); if( is_home() || is_front_page() ) { if( "0" == $options[ 'disable_slider' ] ) { if( function_exists( 'attitude_pass_cycle_parameters' ) ) attitude_pass_cycle_parameters(); if( function_exists( 'attitude_featured_post_slider' ) ) attitude_featured_post_slider(); } } else { if( ( '' != attitude_header_title() ) || function_exists( 'bcn_display_list' ) ) { ?> <div class="page-title-wrap"> <div class="container clearfix"> <?php if( function_exists( 'attitude_breadcrumb' ) ) attitude_breadcrumb(); ?> <h3 class="page-title"><?php echo attitude_header_title(); ?></h3><!-- .page-title --> </div> </div> <?php } } if( 'below-slider' == $options[ 'slogan_position' ] && ( is_home() || is_front_page() ) ) if( function_exists( 'attitude_home_slogan' ) ) attitude_home_slogan(); } ?>
March 17, 2014 at 7:46 pm #8792SchmalitzParticipantHi all,
@Sanjip Shah – I think there is a tiny little mistake in your code – line 6-7. Your code is:
function attitude_remove_parent_function(){ remove_action( 'attitude_header', 'attitude_child_headerdetails', 10 );
…which didn’t work for me. It should be like the following instead:
function attitude_remove_parent_function(){ remove_action( 'attitude_header', 'attitude_headerdetails', 10 );
That made it for me. Otherwise these lines are removing the action/function you actually want to add in the next lines. Do you agree?
I’m not an expert at all but if you agree you could maybe change the orginal code on page 1 of this thread. It took me quite a while to find out. Thank you very muich for your help anyway!
Kind regards
SchmalitzMarch 18, 2014 at 8:07 am #8821Theme Horse Support TeamKeymasterHi Riou
Please create your own thread and post your comment clearly what you actually want to do? Make a clear about it. -
AuthorPosts
- You must be logged in to reply to this topic.