Tagged: x
-
AuthorPosts
-
June 11, 2016 at 5:15 pm #1037643
AndrewParticipanthttp://127.0.0.1:4001/wordpress/
X 4.5.2; WP 4.5.2; CS 1.2.4Hi,
On April 29, 2015, (#261236) a few support members helped a forum member customize their navbar to display social icons by editing the _navbar.php file in the x-child theme. The solution worked perfectly.
The social icons in the solution were links to various social sites implemented like this;
- <i class=”x-icon-facebook” data-x-icon=””></i>
- <i class=”x-icon-twitter” data-x-icon=””></i>
- <i class=”x-icon-linkedin” data-x-icon=””></i>
I need to have the link icons’ functionality changed to share icons – just as they would be if using X’s social share shortcodes. I could not find a way to insert social shortcodes into the structure.
Could you help?
Cheers!
Andrew
(Although I’ve given my URL above, it’s on a localhost and probably unreachable – sorry.)June 12, 2016 at 12:03 am #1037910
Rue NelModeratorHello Andrew,
Thanks for writing in! Could please share the url of the topic of your reference? For the meantime, you can always edit your _navbar.php and insert a social share shortcode by adding a code like this:
<?php echo do_shortcode('[x_share title="Share this Post" share_title="" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true" reddit="true" email="true" email_subject="Hey, thought you might enjoy this! Check it out when you have a chance:"]'); ?>Hope this helps. Please let us know how it goes.
June 12, 2016 at 11:05 am #1038309
AndrewParticipantHi Rue!
Thanks for the code and input.
This is the link with the navbar/social icons solution I referenced;
https://community.theme.co/forums/topic/social-icons-to-the-right-of-navbar-menu/
I implemented this solution, and the only change I wanted to make was having SHARE icons as opposed to social LINK icons. Your code snippet worked, but because of not being up to speed with PHP, I arbitrarily inserted the code which was messy.
The previous solution also provided the accompanying CSS which I’ll need to style the icons and integrate them with the navbar.
Hope you can help.
Cheers!
Andrew
June 12, 2016 at 7:46 pm #1038808
RadModeratorHi Andrew,
I like to clarify first, you wish to achieve sharing functionality on the navbar instead of just social links? Is that right?
Thanks!
June 13, 2016 at 12:05 pm #1039948
AndrewParticipantHey Rad!
Thanks for coming back to me.
Yes, I do want to incorporate the Share social icons in my navbar. I’ve attached an image of how it currently looks with Rue Nel’s <?php echo do_shortcode solution. The functionality is there, but I still need to do some styling (getting rid of the background of the icons, and the faint line below them). I have global styling for the social icons on my pages, but this does not target those in the navbar.
In the attachment you’ll see what I currently have, and what I’m aiming for as a final implementation.
Trusting you can help,
Cheers!
Andrew
June 13, 2016 at 12:07 pm #1039952
AndrewParticipantHi Rad,
My apologies, I forgot the image attachment in the previous post.
Cheers!
Andrew
June 13, 2016 at 3:02 pm #1040227
Nabeel AModeratorHi there,
Thanks for providing the screenshot, this can be fixed with custom CSS, can you please try uploading the site on live environment so we can suggest a tailored solution? In the mean time try adding the following code in your Customizer:
.x-share-options { margin-top: -40px !important; }Adjust the margin accordingly. Let us know how this goes!
June 14, 2016 at 7:55 am #1041314
AndrewParticipantHi Nabeel,
Thanks for the CSS and the response.
Unfortunately I don’t have a live environment yet, so I’ve attached another JPG of where I currently am.
The CSS you gave was for a global implementation, and I saw in a previous solution (see above), the social share icons in the navbar were given a different class. I added your CSS under that class that only targeted the navbar icons and not the icons globally.
I’m just about there with the exception of spacing. The social icons in the navbar (see attached image), have a thin line below them, and I assume some padding/margin below the line. This causes the icons to expand the navbar to accommodate them. I need to take out this extra decoration and any other padding below the icons.
Trust you can help,
Andrew
June 14, 2016 at 11:01 am #1041622
JoaoModeratorHi There,
To get rid of the lines under your social icons you need to use a CSS like this
.theclassgiven { text-decoration: none !important; }To help assist with the issue, you also could click with the right button of your mouse over those social icons, inspect it, and provide us a screenshot so we can see what is happening.
Hope it helps,
Joao
June 15, 2016 at 10:11 am #1043385
AndrewParticipantHi Joao,
Thanks for getting back to me.
I’ve attached the Inspector screenshot as requested, and have included the _navbar.php file from the x-child theme directory which I hope will help you to assist me.
Overall we’re very close.
Cheers!
Andrew
June 15, 2016 at 10:14 am #1043397
AndrewParticipantHi Joao,
I see the _navbar.php file did not upload. I’ve renamed it and am trying again.
Cheers!
Andrew
June 15, 2016 at 10:16 am #1043400
AndrewParticipantHi again,
I see that didn’t work either.
Let me try again.
Cheers!
Andrew
June 15, 2016 at 10:54 am #1043473
AndrewParticipantHi some more!
This should work – it’s a JPG file
Cheers!
Andrew
June 15, 2016 at 1:07 pm #1043673
JadeModeratorHi Andrew,
Kindly try this code:
.social_by_nav a { text-decoration: none !important; }Hope this helps.
June 16, 2016 at 3:23 pm #1045814
AndrewParticipantHi Jade,
Thanks for the code, but unfortunately it did not have the effect we wanted. I’ve added the current CSS for the navbar social sharing icons below hoping it will allow you to assist.
The only issue with the icons is the thin line above and below the icons.
————————
.social_by_nav a {
text-decoration: none !important;
}.social_by_nav {
float: right;
margin-top: -25px !important;
top: 0;
position: relative;
display:inline-block;
text-align: center;
text-decoration: none !important;}
.social_by_nav .x-share:hover {
background-color: transparent;
color: #00123b;
}.social_by_nav:first-child:before{
content: “Share”;
font-size: 10px;
position: absolute;
left: -25px;
top: 34px;
display: inline-block;
}—————–
Cheers!
Andrew
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1037643 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
