Community Forums › Forums › Archived Forums › Design Tips and Tricks › make inner pages header click to different url
- This topic has 2 replies, 1 voice, and was last updated 11 years ago by KarenLeighBurton.
-
AuthorPosts
-
February 21, 2013 at 9:44 pm #22129KarenLeighBurtonMember
Hi all, hoping someone can help.
I have a site where on the home page (route of the site) the header of course links to that page, BUT on all interior pages and posts I want the psudo homepage to be a different page if someone clicks on the header rather than taking them back to the main url (as that is a landing type sales page). I am using the genesis theme and just having absolutely no luck.
basically
if you go to http://www.mybirthbusinessrocks.com the header can click to this url as it is the sales page and I don't want anyone having access to the interior until they have purchased the program
once someone purchases the program I don't want them to ever see the main homepage again (unless they specifically type it in), so lets say they are on url http://www.mybirthbusinessrocks.com/class1 and click on the header (by accident) I want it to take them to http://www.mybirthbusinessrocks.com/welcome since there is no way back to the interior of the site from the sales/landing page.
is there a way to do this? if so can someone help me (I am completely php newbie and don't understand hooks very well, but I can copy and paste like a master 🙂
appreciate the help
February 21, 2013 at 10:44 pm #22139KarenLeighBurtonMemberSo, I've found this little piece of code... which works great to just change the url, but i still need the home page header to simply either not link to anything or only link to the sales page (home page)
function child_header_title( $title, $inside, $wrap ) {
$inside = sprintf( '<a href="http://mybirthbusinessrocks.com/student-login/" title="%s">%s</a>', esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) );
return sprintf( '<%1$s id="title">%2$s</%1$s>', $wrap, $inside );
}I tried using a conditional is_front_page() with it, but all it does is give me errors and I have to go in through cpanel and reupload the functions.php. Can someone tell me what i am doing wrong?
February 21, 2013 at 11:20 pm #22147KarenLeighBurtonMemberWoo Hoo! I finally, after about 30 different restores of the functions.php found the correct way to do this.... so if anyone needs it here it is!!!!!
add_filter( 'genesis_seo_title', 'child_header_title', 10, 3 );
/**
* Change default Header URL.
*/function child_header_title( $title, $inside, $wrap ) {
if ( is_front_page() ) {
$inside = sprintf( '<a href="http://www.yourdomain.com/" title="%s">%s</a>', esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) );
} else {
$inside = sprintf( '<a href="http://www.yourdomain.com/innerpage/" title="%s">%s</a>', esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) );
}
return sprintf( '<%1$s id="title">%2$s</%1$s>', $wrap, $inside );
} -
AuthorPosts
- The topic ‘make inner pages header click to different url’ is closed to new replies.