- This topic is empty.
-
AuthorPosts
-
October 28, 2014 at 8:06 am #187179sfosheeParticipant
I added a WPML language selector to the top right of my page using the following code:
<div style="float: right;"><?php do_action('icl_language_selector'); ?></div>
I need it to be on the same line as the header image, not taking up any more lines on the page. It worked, except that it moved the header image over so it is not centered anymore. Both the header image and the language selector box look small enough to fit next to each other, but still the center is offset on the header image. I keep playing with it, but can’t get it right. Please, does anyone have any ideas to help? Here is a representative page:
http://lallabee.com/wordpress/?page_id=41Thank you for your help!
October 28, 2014 at 8:23 am #187182Paulie_DMemberI wouldn’t float the language selector for the very reason you have just discovered.
Instead,
.site-header { margin: 0 auto; position: relative; /*add this */ }
Then the language selector should be positioned absolutely. The div has no ID but I’m sure you know which one it is.
/* float: right; */ /* remove this */ position: absolute; right: 0; }
October 28, 2014 at 9:18 am #187191sfosheeParticipantThank you. I’m sorry but I’m confused. Which code should I add, the top or the bottom or both? Does it go in the edit CSS section? Here is the code to insert the language selector
<?php do_action('icl_language_selector'); ?>
Thank you so much!
October 28, 2014 at 9:28 am #187193sfosheeParticipantSo add this in the Edit CSS section:
`
.site-header {
margin: 0 auto;
position: relative;
}`
And then add this where I had it before in the Header.php file:
<div style="position: absolute; right: 0;"><?php do_action('icl_language_selector'); ?></div>
Is that right?
October 28, 2014 at 9:37 am #187196sfosheeParticipantI just inserted
<div style="position: absolute; right: 0;"><?php do_action('icl_language_selector'); ?></div>
in the Header.php file and that seemed to do the trick. Should I still add the`.site-header {
margin: 0 auto;
position: relative;
}` in the Edit CSS section?
October 28, 2014 at 9:54 am #187201sfosheeParticipantOK, I think that has it. Thank you very much for your help!
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.