gTranslate WP shortcode not working, PHP call instead?

Popular automatic website translation tool

gTranslate WP shortcode not working, PHP call instead?

Postby klikster » Thu Jul 07, 2011 10:15 pm

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!
klikster
 
Posts: 3
Joined: Thu Jul 07, 2011 10:13 pm

Re: gTranslate WP shortcode not working, PHP call instead?

Postby Edvard » Sat Jul 09, 2011 3:31 pm

Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4183
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: gTranslate WP shortcode not working, PHP call instead?

Postby klikster » Tue Jul 12, 2011 1:19 am

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?
klikster
 
Posts: 3
Joined: Thu Jul 07, 2011 10:13 pm

Re: gTranslate WP shortcode not working, PHP call instead?

Postby Edvard » Tue Jul 12, 2011 2:20 pm

It will be: echo do_shortcode('[gtranslate]');
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4183
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: gTranslate WP shortcode not working, PHP call instead?

Postby klikster » Tue Jul 12, 2011 10:01 pm

Thank you very much!
klikster
 
Posts: 3
Joined: Thu Jul 07, 2011 10:13 pm

Re: gTranslate WP shortcode not working, PHP call instead?

Postby ultra » Wed Feb 15, 2012 11:38 pm

I also tried to paste the code in the header.php but it's not working. Where would I add it precisely?
ultra
 
Posts: 1
Joined: Wed Feb 15, 2012 11:35 pm

Re: gTranslate WP shortcode not working, PHP call instead?

Postby Yana » Thu Feb 16, 2012 12:35 am

Hi,
You can add this code in header.php after the <body> tag.

<?php echo do_shortcode('[gtranslate]'); ?>
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4129
Joined: Thu Jan 12, 2012 6:21 pm

Re: gTranslate WP shortcode not working, PHP call instead?

Postby arvacon » Sun May 19, 2013 11:16 pm

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
arvacon
 
Posts: 5
Joined: Sun May 19, 2013 11:13 pm

Re: gTranslate WP shortcode not working, PHP call instead?

Postby Yana » Mon May 20, 2013 5:17 pm

Dear Arvacon,

You can make changes in your css to change the position of the language selector.

Thank you.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4129
Joined: Thu Jan 12, 2012 6:21 pm

Re: gTranslate WP shortcode not working, PHP call instead?

Postby arvacon » Wed May 22, 2013 5:31 am

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:
arvacon
 
Posts: 5
Joined: Sun May 19, 2013 11:13 pm

Re: gTranslate WP shortcode not working, PHP call instead?

Postby Yana » Wed May 22, 2013 8:22 pm

Hi,
If you can post your website address I'll try to help you.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4129
Joined: Thu Jan 12, 2012 6:21 pm

Re: gTranslate WP shortcode not working, PHP call instead?

Postby arvacon » Fri May 24, 2013 3:44 am

Hi.
You have pm
arvacon
 
Posts: 5
Joined: Sun May 19, 2013 11:13 pm

Re: gTranslate WP shortcode not working, PHP call instead?

Postby Yana » Fri May 24, 2013 6:32 pm

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]'); ?>
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4129
Joined: Thu Jan 12, 2012 6:21 pm

Re: gTranslate WP shortcode not working, PHP call instead?

Postby arvacon » Fri May 24, 2013 9:12 pm

Yana wrote:Dear Arvacon,

You can make changes in your css to change the position of the language selector.

Thank you.


arvacon wrote: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?
arvacon
 
Posts: 5
Joined: Sun May 19, 2013 11:13 pm

Re: gTranslate WP shortcode not working, PHP call instead?

Postby Yana » Sun May 26, 2013 4:24 pm

Hi,
Please replace <?php echo do_shortcode('[gtranslate]'); ?> with the following

<div align="right"> <?php echo do_shortcode('[gtranslate]'); ?> </div>
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4129
Joined: Thu Jan 12, 2012 6:21 pm

Re: gTranslate WP shortcode not working, PHP call instead?

Postby arvacon » Sun May 26, 2013 10:16 pm

Hi,
Thanks for the great help, this worked like a charm :)
arvacon
 
Posts: 5
Joined: Sun May 19, 2013 11:13 pm

Re: gTranslate WP shortcode not working, PHP call instead?

Postby Yana » Sun May 26, 2013 11:44 pm

You're welcome! :)
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4129
Joined: Thu Jan 12, 2012 6:21 pm


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

2GLux