Community Forums › Forums › Archived Forums › Design Tips and Tricks › Canging News Pro custom header link
Tagged: header link, News Pro
- This topic has 3 replies, 2 voices, and was last updated 9 years, 4 months ago by
styzer.
-
AuthorPosts
-
October 12, 2015 at 9:00 pm #167989
styzer
ParticipantHi, I am in a bit of trouble: I changed the header image and don't remember how to modify the URL, which should lead to an external site. I tried a few snippets that are said to do this, but it didn't work...
//* Modify the header URL add_filter( 'genesis_seo_title', 'sp_seo_title', 10, 3 ); function sp_seo_title($title, $inside, $wrap) { $inside = sprintf( '<a href="http://vi-control.net/community" title="%s">%s</a>', esc_attr( get_bloginfo('name') ), get_bloginfo('name') ); $title = sprintf( '<%s class="site-title" itemprop="headline">%s</%s>', $wrap, $inside, $wrap ); return $title; }
Anyone can direct me to a solution?
Much appreciated,
Site: http://vi-control.net/portal
Andre
http://vi-control.net/portalOctober 13, 2015 at 1:06 am #168006Brad Dalton
ParticipantYour code works on XHTML themes
Use this 2nd snippet for HTML 5 themes
http://my.studiopress.com/snippets/header/
October 13, 2015 at 2:19 am #168009styzer
ParticipantHi Brad,
OK, so I have used both XHTML and HTML5 snippets.
//* Modify the header URL - HTML5 Version add_filter( 'genesis_seo_title', 'child_header_title', 10, 3 ); function child_header_title( $title, $inside, $wrap ) { $inside = sprintf( '<a href="http://www.vi-control.net/community" title="%s">%s</a>', esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) ); return sprintf( '<%1$s class="site-title">%2$s</%1$s>', $wrap, $inside ); } //* Modify the header URL - XHTML Version add_filter('genesis_seo_title', 'sp_seo_title', 10, 3); function sp_seo_title($title, $inside, $wrap) { $inside = sprintf( '<a href="http://www.vi-control.net/community" title="%s">%s</a>', esc_attr( get_bloginfo('name') ), get_bloginfo('name') ); $title = sprintf('<%s id="title">%s</%s>', $wrap, $inside, $wrap); return $title; }
However, now the header isn't showing... I refreshed many times... what could be the cause then?
Thank you!
October 13, 2015 at 2:40 am #168010styzer
ParticipantOK, Brad, it''s working now.
Changes I made: left the paragraph break before the "return" tags, and took out the www in the URL. Not sure if that did anything but now the header is showing here.
Many thanks! 🙂
//* Modify the header URL add_filter( 'genesis_seo_title', 'sp_seo_title', 10, 3 ); function sp_seo_title($title, $inside, $wrap) { $inside = sprintf( '<a href="http://vi-control.net/community" title="%s">%s</a>', esc_attr( get_bloginfo('name') ), get_bloginfo('name') ); $title = sprintf( '<%s class="site-title" itemprop="headline">%s</%s>', $wrap, $inside, $wrap ); return $title; } //* Modify the header URL - HTML5 Version add_filter( 'genesis_seo_title', 'child_header_title', 10, 3 ); function child_header_title( $title, $inside, $wrap ) { $inside = sprintf( '<a href="http://vi-control.net/community" title="%s">%s</a>', esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) ); return sprintf( '<%1$s class="site-title">%2$s</%1$s>', $wrap, $inside ); }
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.