- This topic has 5 replies, 2 voices, and was last updated 9 years, 9 months ago by ainaC.
-
AuthorPosts
-
March 9, 2015 at 7:41 am #52938ainaCMember
Website: http://smcpurebuzz.com/news/
Message: I am trying to change the link of the logo by copying the function catcheverest_header_left() from catcheverest functions.php to my child theme funtion file where I change the line <?php echo esc_url( home_url( ‘/’ ) ); ?> to
http://smcpurebuzz.com/, but I just get a syntax error message. Could you please help me with the correct code to let me change the link of the logo? I do not know much about php coding, so I am not sure if I chould copy the whole code for catcheverest_header_left() or just the part I need to change. Any of the ways didt work, I just get the message that its something wrong with the code.Thank you so much for your help and great theme!
March 9, 2015 at 11:40 pm #52981SakinKeymaster@ainaC: I don’t know how you have done it. Yes, you need to copy whole function
catcheverest_header_left
in your child themefunctions.php
file in your child theme then replace the following css:
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
With the following css:
<a href="http://smcpurebuzz.com/" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
March 11, 2015 at 9:34 am #53081ainaCMemberHi, well again this is what I have tried. I pasted this code in my fuctions.php:
function catcheverest_header_left() { ?>
<div id=”header-left”>
<?php
// Check to see if the header image has been removed
global $_wp_default_headers;
$header_image = get_header_image();
if ( ! empty( $header_image ) ) : ?>
<h1 id=”site-logo”>” rel=”home”>
” width=”<?php echo get_custom_header()->width; ?>” height=”<?php echo get_custom_header()->height; ?>” alt=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” />
</h1>
<div id=”hgroup” class=”with-logo”>
<?php else :
echo ‘<div id=”hgroup”>’;
endif; // end check for removed header image ?><h1 id=”site-title”>” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?></h1>
<h2 id=”site-description”><?php bloginfo( ‘description’ ); ?></h2>
</div><!– #hgroup –>
</div><!– #header-left –><?php
}
endif; // catcheverest_header_leftadd_action( ‘catcheverest_hgroup_wrap’, ‘catcheverest_header_left’, 10 );
and I get tis error:
Parse error: syntax error, unexpected ‘endif’ (T_ENDIF) in /customers/7/7/1/smcpurebuzz.com/httpd.www/news/wp-content/themes/mycatch/functions.php on line 88Even if I take it out again I get the same error. I have to upload the previous functions.php again to get the site up and running again. So I dont get what I am doing wrong. Do you have any suggestions? Please…
I was reading on one other post that you wrote a shorter code to remove the logo image link. So it is not any other code that could work?
thanks for your answer.
March 11, 2015 at 10:29 am #53084ainaCMembersorry, I pasted this code:
function register_my_menus() {
register_nav_menus(
array(
‘service’ => __( ‘Service’ ),
‘testimonials’ => __( ‘Testimonials’ )
)
);
}
add_action( ‘init’, ‘register_my_menus’ );function catcheverest_header_left() { ?>
<div id=”header-left”>
<?php
// Check to see if the header image has been removed
global $_wp_default_headers;
$header_image = get_header_image();
if ( ! empty( $header_image ) ) : ?>
<h1 id=”site-logo”>” rel=”home”>
” width=”<?php echo get_custom_header()->width; ?>” height=”<?php echo get_custom_header()->height; ?>” alt=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” />
</h1>
<div id=”hgroup” class=”with-logo”>
<?php else :
echo ‘<div id=”hgroup”>’;
endif; // end check for removed header image ?><h1 id=”site-title”>” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?></h1>
<h2 id=”site-description”><?php bloginfo( ‘description’ ); ?></h2>
</div><!– #hgroup –>
</div><!– #header-left –><?php
}
endif; // catcheverest_header_leftadd_action( ‘catcheverest_hgroup_wrap’, ‘catcheverest_header_left’, 10 );
BTW: could I ask you to see if you could find out why the page is going horizontally where it is no content?
March 11, 2015 at 10:35 am #53085ainaCMemberI am so sorry, I dont know what happened, again I pasted the wrong code in the post. The code under is the one I pasted in the function.php:
function catcheverest_header_left() { ?>
<div id=”header-left”>
<?php
// Check to see if the header image has been removed
global $_wp_default_headers;
$header_image = get_header_image();
if ( ! empty( $header_image ) ) : ?>
<h1 id=”site-logo”>” rel=”home”>
” width=”<?php echo get_custom_header()->width; ?>” height=”<?php echo get_custom_header()->height; ?>” alt=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” />
</h1>
<div id=”hgroup” class=”with-logo”>
<?php else :
echo ‘<div id=”hgroup”>’;
endif; // end check for removed header image ?><h1 id=”site-title”>” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?></h1>
<h2 id=”site-description”><?php bloginfo( ‘description’ ); ?></h2>
</div><!– #hgroup –>
</div><!– #header-left –><?php
}
endif; // catcheverest_header_leftadd_action( ‘catcheverest_hgroup_wrap’, ‘catcheverest_header_left’, 10 );
March 11, 2015 at 10:52 am #53086ainaCMemberThat is strange, It is just changing when I post… I tried again several times and I realized I forgot the if
if ( ! function_exists( 'catcheverest_header_left' ) ) :
So It is working!!! Thanks you again. But if you could look at the horizontal scrolling problem that would be great!!Thank you
-
AuthorPosts
- The topic ‘How to change logo image link in child function.php’ is closed to new replies.