Forum Archive - gTranslate WP shortcode not working, PHP call instead?

gTranslate WP shortcode not working, PHP call instead?
Jul 7, 2011 6:15 pm by klikster
Hi, I've added gTranslate to my site and I'm excited to get it working, unfortunately I don't want the widget, and I don't want it added into direct content.. I want to add it to a specific part of my theme, but adding the [GTranslate] that it set in the plugin settings doesn't seem to work when I place it in my header.php I'm curious if there's a direct PHP function I can call that will load the gTranslate widget just like the shortcode does? Thank you!
Re: gTranslate WP shortcode not working, PHP call instead?
Jul 9, 2011 11:31 am by Edvard
Check this out: http://codex.wordpress.org/Function_Ref ... _shortcode
Re: gTranslate WP shortcode not working, PHP call instead?
Jul 11, 2011 9:19 pm by klikster
I only partially understand how this would benefit me unfortunately. I'm trying to implement this into my header.php file.. so where would I add this?
Re: gTranslate WP shortcode not working, PHP call instead?
Jul 12, 2011 10:20 am by Edvard
It will be: echo do_shortcode('[gtranslate]');
Re: gTranslate WP shortcode not working, PHP call instead?
Jul 12, 2011 6:01 pm by klikster
Thank you very much!
Re: gTranslate WP shortcode not working, PHP call instead?
Feb 15, 2012 7:38 pm by ultra
I also tried to paste the code in the header.php but it's not working. Where would I add it precisely?
Re: gTranslate WP shortcode not working, PHP call instead?
Feb 15, 2012 8:35 pm by Yana
Hi, You can add this code in header.php after the <body> tag. <?php echo do_shortcode('[gtranslate]'); ?>
Re: gTranslate WP shortcode not working, PHP call instead?
May 19, 2013 7:16 pm by arvacon
Hi and thanks for this beautiful plugin. I know this topic is old now, but I have a question about the above code. I used it with success, but I would like to put the flags at the right top corner instead of the left that it is now. Can you help me about what else do I need to type at the php code to make this change? Thanks in advance, Arvacon
Re: gTranslate WP shortcode not working, PHP call instead?
May 20, 2013 1:17 pm by Yana
Dear Arvacon, You can make changes in your css to change the position of the language selector. Thank you.
Re: gTranslate WP shortcode not working, PHP call instead?
May 22, 2013 1:31 am by arvacon
Thanks for your answer. Actually if I do changes at the css about this, wouldn't this affect the whole header or it is there any specific code about this specific place that gtranslate uses? Can you be a little more specific if it is easy, because I am a little newbie? :roll:
Re: gTranslate WP shortcode not working, PHP call instead?
May 22, 2013 4:22 pm by Yana
Hi, If you can post your website address I'll try to help you.
Re: gTranslate WP shortcode not working, PHP call instead?
May 23, 2013 11:44 pm by arvacon
Hi. You have pm
Re: gTranslate WP shortcode not working, PHP call instead?
May 24, 2013 2:32 pm by Yana
Hi, Please try to put the following php code in your template. Also you can use the free html code instead of the plugin <?php echo do_shortcode('[gtranslate]'); ?>
Re: gTranslate WP shortcode not working, PHP call instead?
May 24, 2013 5:12 pm by arvacon
Dear Arvacon, You can make changes in your css to change the position of the language selector. Thank you. Thanks for your answer. Actually if I do changes at the css about this, wouldn't this affect the whole header or it is there any specific code about this specific place that gtranslate uses? Can you be a little more specific if it is easy, because I am a little newbie? :roll: Hi. It's me Arvacon that you told me send you my site to see if you can help about the position of the gtranslate. I have already put the php code at the site, you can visit it and see the small little Greek flag at the top left corner. What do I need to change at the css, to make it go at the top right corner?
Re: gTranslate WP shortcode not working, PHP call instead?
May 26, 2013 12:24 pm by Yana
Hi, Please replace <?php echo do_shortcode('[gtranslate]'); ?> with the following <div align="right"> <?php echo do_shortcode('[gtranslate]'); ?> </div>
Re: gTranslate WP shortcode not working, PHP call instead?
May 26, 2013 6:16 pm by arvacon
Hi, Thanks for the great help, this worked like a charm :)
Re: gTranslate WP shortcode not working, PHP call instead?
May 26, 2013 7:44 pm by Yana
You're welcome! :)

SIMILAR TOPICS

Gtranslate MultisiteFeb 12, 2019 7:27 amReplies: 1Post by: infact_dat
Gtranslate: Error with numberFeb 20, 2019 1:20 amReplies: 1Post by: infact_dat
GTranslate 3.7.4, Joomla 3.9.3 - doGTranslate is not definedFeb 22, 2019 12:34 pmReplies: 1Post by: oase
Add-on gtranslate no longer worksFeb 2, 2019 6:01 amReplies: 1Post by: DarylDixon
Instragram and Gtranslate...!!!!Dec 19, 2018 11:18 amReplies: 1Post by: zackfernandes

Try GTranslate with a free 15 day trial