-
AuthorPosts
-
February 26, 2016 at 12:14 pm #813740
Hi, I would like to add the Paypal button on my top menu, to the right of the magnifying glass.
I have installed a plugin giving me a classic code [paypal etc etc] and the possibility to use it as widget, but I prefer show the button on top of the page in the menu.
Please could you help me?And another little thing… I don’t why ONLY WITH FIREFOX I see a blue rectangle when I click something…
Thank you as always!Augusto
ps the site is http://linvitatospeciale.it and your theme works as a charm!
February 26, 2016 at 9:35 pm #814274Hello There,
Thanks for writing in!
Since you already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.
// Add a paypal menu item // ============================================================================= function add_paypal_menu_items( $items, $args ){ if ( $args->theme_location == 'primary' ) { $items .= '<li id="x-menu-item-paypal" class="menu-item x-menu-item x-menu-item-paypal">' . '[wpedon id=5601]' . '</li>'; } return $items; } add_filter( 'wp_nav_menu_items', 'add_paypal_menu_items', 10000, 2 ); // =============================================================================
You must place the correct shortcode for the correct button. After adding the code, you must add this custom css code in the customizer as well to align it properly.
.x-navbar .desktop .x-nav li.x-menu-item-paypal > div { padding-top: 20px; }
To resolve the blue boxes in Firefox when you hover on a link, please add the following css code in the customizer, Appearance > Customize > Custom > CSS
a:focus, select:focus, input[type="file"]:focus, input[type="radio"]:focus, input[type="submit"]:focus, input[type="checkbox"]:focus { outline: none; }
Hope this helps.
February 28, 2016 at 5:06 pm #815969Dear support thank you so much!
No more blue boxes in Firefox but a strange situation.Adding the code in the child functions.php I can see the Paypal code (in the menu) but the code is not interpreted… instead if we use the same code [wpedon id=5601] in a page: http://linvitatospeciale.it/an-x-test/ it works!
Nevertheless everything seems quite correct to me… thank you again!!
Augusto
February 28, 2016 at 7:01 pm #816057Hi Augusto,
Thanks for updating the thread! Shortcodes won’t work in the Menu Labels, but HTML will. You can use the following instead of the [wpedon id=5601].
<form target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_donations"><input type="hidden" name="business" value="ad@windowsgold.com"><input type="hidden" name="item_name" value=""><input type="hidden" name="item_number" value=""><input type="hidden" name="currency_code" value="EUR"><input type="hidden" name="amount" id="amount_09ca07eea658338082845554b566cf5f" value=""><input type="hidden" name="no_note" value="1"><input type="hidden" name="no_shipping" value="1"><input type="hidden" name="notify_url" value="http://linvitatospeciale.it/wp-admin/admin-post.php?action=add_wpedon_button_ipn"><input type="hidden" name="lc" value="it_IT"><input type="hidden" name="bn" value="WPPlugin_SP"><input type="hidden" name="return" value="http://linvitatospeciale.it"><input type="hidden" name="cancel_return" value="http://linvitatospeciale.it"><input class="wpedon_paypalbuttonimage" type="image" src="https://www.paypal.com/it_IT/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="Make your payments with PayPal. It is free, secure, effective." style="border: none;"><img alt="" border="0" style="border:none;display:none;" src="https://www.paypal.com/it_IT/i/scr/pixel.gif" width="1" height="1"></form>
Hope this helps – thanks!
February 29, 2016 at 8:12 am #816765With your help now it is perfect!!!
Augusto
February 29, 2016 at 8:29 am #816776Glad we were able to help 🙂
If you need anything else, please let us know.
-
AuthorPosts