Archived

This topic is now archived and is closed to further replies.

  • 0

positioning qtranslate plugin within the header

Question

Posted · Report post

Hi,
I would like to have the qtranslate plugin widget positioned above the 'share' buttons near the site logo/header. I need to put this code: (<?php echo qtrans_generateLanguageSelectCode('both'); ?>)  into, I guess, one of the page templates or files. Can someone give me a filename or direction on this?

see my page at http://filmisreal.com/wordpress/   - you can see the qtranslate widget is now positioned to the left and bottom of the logo and just takes up space....

Share this post


Link to post
Share on other sites

15 answers to this question

Posted · Report post

Hi,

 

That code may be added to the header area as a hook, which is the best possible way to add it.

 

If you are using a child theme, you'll add this hook into the functions.php file within the child theme. 

 

If not, you will want to install or use the PageLines Customize plugin (free in our Store) along with the Action Map plugin, also free in the Store. 

 

Optionally, you can use the Hooker plugin which saves you doing the coding. Use Hooker in conjunction with Action Map.  The Action Map helps you identify the hook (area) that exists where you want to place your code.  Once you've found it, using Hooker, you just select that hook from the drop down list, and paste your code.

 

The only critical recommendation I'd make to you is that you wrap the php code in a div with a custom class as such:

<div class="myqtranslate1">
<?php echo qtrans_generateLanguageSelectCode('both'); ?>
</div>

By doing that, you have the ability to add some simple CSS to your Custom Code, such as:

.myqtranslate1 {float: right; }

Rest assured, it will be essential to style, position or otherwise affect the appearance of the QTranslate you add to the header.

Share this post


Link to post
Share on other sites

Posted · Report post

Thank You very much Rob. I will try it out and report back if any trouble...

Share this post


Link to post
Share on other sites

Posted · Report post

You're very welcome.  Keep us updated about your progress.

Share this post


Link to post
Share on other sites

Posted · Report post

Mmm. I purchased the hooker plugin which I installed, activated and added a new hook - before branding icons. I entered the qtranslate php code there and no go....

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

 

Did you add the code with the div I recommended as well? And did you add the Custom CSS to Dashboard > PageLines > Site Options > Custom Code?

Share this post


Link to post
Share on other sites

Posted · Report post

Yes I did....any ideas?

Share this post


Link to post
Share on other sites

Posted · Report post

Create a new Admin level user and email the details to robert@pagelines.com.  I'll login and have a look. 

Share this post


Link to post
Share on other sites

Posted · Report post

sent...

Share this post


Link to post
Share on other sites

Posted · Report post

Nothing received yet.  Please make sure credentials are sent to robert@pagelines.com.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

 

For some reason, it didn't seem to work correctly until I implemented it using PageLines Customize and activated that. I've deactivated Action Map.

 

The flags are now present.  You're going to have to style them as you desire. Presently they show as a bulleted vertical list following the social media icons. They are picking up styling from qTranslate, not PageLines. Please seek support from them for styling. You may also  use Firebug for Firefox or Chrome's Inspection Tool to find the correct CSS.  Once found, it may be added to Dashboard > PageLines > Site Options > Custom Code.

 

Hooker wasn't working correctly, likely due to a plugin conflict.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks very much for your help and persistence Rob. I'll investigate the styling issues.
- Any idea what hooker conflicts with? Would like to get it working at some point...

Share this post


Link to post
Share on other sites

Posted · Report post

I plan to follow up with the developer as soon as he's on duty, likely Monday. I'll reply here as soon as I hear back from him.

Share this post


Link to post
Share on other sites

Posted · Report post

Yasha,

 

FTP into your site and find the wp-config.php file.

 

Open it for editing in a text editor (not Word or WordPad).

 

Find define('WP_DEBUG', false);

 

Then below it, insert a new line and add:

define( 'PL_HOOKS_PHP', true );

This will make Hooker work.

Share this post


Link to post
Share on other sites

Posted · Report post

Great - I'll check it and report back. Thx so much

Share this post


Link to post
Share on other sites

Posted · Report post

Super. No problem.

Share this post


Link to post
Share on other sites