Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › PHP or Shortcode in the header
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › PHP or Shortcode in the header
- This topic has 23 replies, 6 voices, and was last updated 7 years by
Rui Guerreiro – SUPPORT.
-
Posted in: Neighborhood
-
April 8, 2014 at 8:52 am #65212
I want to add a currency switcher to the front end as described here: http://wpml.org/documentation/related-projects/woocommerce-multilingual/multi-currency-support-woocommerce/#attachment_325266
I think I want it here: http://i.gyazo.com/6ae1bcc46560c9b0c29f7e311624a3e2_1.png but where can I insert the PHP or shortcode? I have tried to insert the PHP at line 376 in wp-content/themes/neighborhood/includes/swift-framework/sf-content-display/sf-header.php but it doesn’t seem to effect the front end.
Hope you can help me further.
April 8, 2014 at 8:55 am #65213Hi there,
To add it there you would have to edit many files.
Unfortunately that is not part of the current theme functionality, and it’s not within the scope of our support to be able to provide that functionality as it is more work than a small customisation. While we’d love to be able to support every customisation request, we simply don’t have the time. We recommend that you seek a freelance developer if you need that functionality, potentially from one of the below resources:
Hope that helps.
– Kyle
April 8, 2014 at 9:22 am #65233Can you tell me which files? I can a bit PHP so maybe I can figure out, if I know the files.
April 8, 2014 at 9:46 am #65255I’m not entirely sure as I didn’t write the code for the theme, but my guess is sf-header.php and the style.css file. However there may be more
– Kyle
April 29, 2014 at 3:20 pm #70833Did you manage to figure this out? I’m trying to add the exact same shortcode to my header but not sure how.
April 30, 2014 at 6:02 am #70966I have inserted:
<div class="currencyswitcher"> <?php echo do_shortcode('[currency_switcher]'); ?> </div>
at line 209 in header.php
The result is like this: http://i.gyazo.com/914b712a81ce1705ebf2e5a0b9222434_1.png
April 30, 2014 at 8:15 am #71017You must have added it in the wrong place, you will need to look for the topbar code
– Kyle
April 30, 2014 at 8:22 am #71024I have tried and tried, but couldn’t figure it out.
April 30, 2014 at 8:32 am #71031Just noticed, that is the place you want it to be, correct? If so I could probably fix it with css to position it inline with the menu and search. If you could provide me with your link I will happily help you with the css for it
– Kyle
May 2, 2014 at 5:59 am #71691Ideally I want it next to (to the left) the language switcher.
May 2, 2014 at 7:35 am #71709You need to move it. Open up sf-header.php and go to header 2, put the code inside:
<div class="header-right span8">
Then add this to your custom css:
.header-right { position: relative; } .valutaskifter { margin-top: 6px; position: absolute; right: 70px; text-align: right; }
– Kyle
May 2, 2014 at 7:46 am #71718Doesn’t seem to work as expected. What’s wrong?
May 2, 2014 at 7:48 am #71720Do you have knowledge of php? Maybe you haven’t added the code correctly.
– Kyle
May 2, 2014 at 7:50 am #71722A bit.. I’ve added it like this:
$header_output .= '<div class="header-right span8"><div class="valutaskifter">'.do_shortcode('[currency_switcher]').'</div>'.sf_aux_links('header-menu').'</div>'. "\n";
May 2, 2014 at 7:56 am #71728Can you show us your website so we can see what “not as expected” means and where we need to tinker?
-
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.