Community Forums › Forums › Archived Forums › General Discussion › Customize "Enable extras on right side"
Tagged: navigation extras
- This topic has 6 replies, 4 voices, and was last updated 13 years, 9 months ago by
lauraM.
-
AuthorPosts
-
December 27, 2012 at 4:03 pm #7751
lauraM
MemberI would like to display a phone number ONLY using "enable extras on right side"
But there are only 4 choices currently to choose from.
Pls help
Thank youDecember 27, 2012 at 5:20 pm #7783Susan
ModeratorLaura - can you please post a link to your site (or let us know what theme you are using). Thanks!
December 27, 2012 at 5:33 pm #7790Jen Baumann
ParticipantThis is a little more involved than you might think, but Bill Erickson has a nice tutorial on customizing this area.
December 27, 2012 at 5:42 pm #7792lauraM
MemberDecember 27, 2012 at 6:31 pm #7805lauraM
MemberI read the tutorial but not sure I understand what I just read.
Can you tell me what code I need to have the code render a phone number?
I no issue editing the code in the functions.php
December 27, 2012 at 9:51 pm #7836wpsmith
MemberHello lauraM,
Try this in functions.php:
add_filter( 'genesis_nav_items', 'be_follow_icons', 25, 2 );
add_filter( 'wp_nav_menu_items', 'be_follow_icons', 25, 2 );
/**
* Follow Icons in Menu
* @author Travis Smith
* @author Bill Erickson
* @link http://www.billerickson.net/genesis-wordpress-nav-menu-content/
*
* @param string $menu HTML menu output.
* @param array $args Array of nav menu arguments.
* @return string HTML menu output.
*/
function be_follow_icons($menu, $args) {
$args = (array)$args;
if ( 'primary' !== $args['theme_location'] ) // Change this to the nav menu location
return $menu;
// Change this below. In case you do not know the text is written for translation.
// If you don't need translation, you can use this: $phone = '<li id="phone">Call us: 999-999-9999</li>';
$phone = '<li id="phone">' . __( 'Call us', 'child-domain' ) . ': 999-999-9999</li>';
return $menu . $phone;
}
December 28, 2012 at 3:16 pm #8000lauraM
MemberThank you so much, the code did indeed solve one part of this issue.
The only other issue I have is the code renders everything just fine on my monitor, however when I switch over to an Iphone or ipad it does not carry the CSS define in the style.css file I have set up.
The CSS I set up was:
#nav li.phone {
padding-top: 7px;
padding-left:50px;
color: #cc9966;
font-size: 20px;}Like I said it looks great on my monitor but take a look on an iphone and you will see it has dropped and is not in-line with the nav bar and also included a vertical line not shown on the monitor as well.
Any ideas??
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.