-
AuthorPosts
-
October 11, 2015 at 7:01 pm #517004
Hi, the documentation is listing a code snippet to create an header widget area.
http://kriesi.at/documentation/enfold/adding-a-widget-area-to-the-header/This works but the widget header area is now outside of the container that defines the width of the site. Is there any hook to place it inside the container where the logo is located? I want the header widget right of the logo for placing a language switcher there. But I don’t want to have it flowing full width but within the hader container where the logo is located. Any tips are appreciated, thanks!
- This topic was modified 9 years, 2 months ago by bluecafe.
October 11, 2015 at 10:25 pm #517053Hey bluecafe!
Can we please check your live web site?
We can help you place it correctly with that way :)Regards,
BasilisOctober 12, 2015 at 7:42 pm #517639Hi Basilis, thanks for your reply. I am presently working with a local test install. I have made a screenshot to demonstrate where the widget area shoud be located
https://www.dropbox.com/s/nvai2pofd30u350/widget.png
Using the codesnippet of the documentation the widget flows outside of the container.
- This reply was modified 9 years, 2 months ago by bluecafe.
October 13, 2015 at 9:14 am #517890Hi,
Did you add the CSS as well? You will have to adjust the left and top values to get it right:
#header .widget { left: 50%; padding-top: 0; position: absolute; top: 0; transform: translate(-50%); }
You can use pixels values as well if you like.
Best regards,
Rikard- This reply was modified 9 years, 2 months ago by Rikard.
October 13, 2015 at 7:13 pm #518288Thanks for your reply. Absolute position such as 50% may work if you want to have the widget in the middle.
However, I want the flags being aligned at the right side of the header container. Absolute pixel values won’t be useful for responsive behaviour. I would like to have it where the social icons menu is meant to be. Is there any hook I could use? Or do you have a hook reference by any chance so that I could look if there is a hook I could use? A hook reference would be very helpful.October 14, 2015 at 7:45 am #518514Hi,
I don’t see the problem with using an absolute position, you might need to add 1 or 2 variations using media queries but that is quickly done with CSS. I’m not sure what you mean by a hook? Would you prefer to add your own code to the source files instead?
Best regards,
RikardOctober 14, 2015 at 8:15 am #518526What I mean is that the suggested code snippet in the documentation
add_action( 'ava_main_header', 'enfold_customization_header_widget_area' ); function enfold_customization_header_widget_area() { dynamic_sidebar( 'header' ); }
is using the hook ava_main_header
This hook is placing in the header region ava_main_header but not inside the container which defines the max-width of the site.
main-header is full width from the left side of the monitor to the right side of the monitor. However I want my widget aligning at the right side of the inner width of the site which is defined by the max-width of the container element (not the full widht of the monitor).
The max-width of the container is defined in the theme settings.
I cannot define a max-width using absolute positioning. This is why I want to add the widget to a hook inside of the container element and not within main_header (which is outside of the container)I have looked in the source file header.php but the header container is most likele created by a function and not located in header.php.
- This reply was modified 9 years, 2 months ago by bluecafe.
October 15, 2015 at 5:42 am #519040Hi,
We can achieve that by using CSS, would you be ok with that?
Best regards,
RikardOctober 15, 2015 at 6:39 am #519056Hi Rikard, if you know a css rule that would achieve this I would gladly use this. What CSS rule do you recommend?
October 16, 2015 at 5:19 am #519662Hi,
Could you provide us with a link to the site in question so that we can take a closer look please?
Best regards,
RikardOctober 16, 2015 at 7:48 am #519691I have uploaded my test environment for you:
http://test.design-meets-code.de/en/What I want to achieve is that the language flags appear in the header area where the social icons (Twitter and Dribble) are placed.
I don’t want to use the social icons … just to demonstrate where I want to place the flags.I assume the social icons are using any hook in the header region? Then I could use this hook to add the polylang widget with the flags to this hook. This is why I asked if there is a hook reference to see the hooks that are available.
Since the flags are outside of the container where the logo and the social icons are placed … how would you use CSS to place them at the place where the social icons are and let them stay there even if the browser window is resized?
October 19, 2015 at 1:57 pm #520924Hi,
Please try the following CSS, replace the one you’re currently using:
#header .widget { left: auto; right: 90px; padding-top: 0; position: absolute; top: 0; transform: translate(-0%); z-index: 999999; }
If you need to make adjustments for mobile sizes then you can use the same code inside of this code:
@media only screen and (max-width: 767px) { CODE GOES HERE }
Regards,
RikardOctober 19, 2015 at 8:01 pm #521165Hi Rikard, thanks for your reply. However, this won’t help much because the absolute positioning is relative to the parent container which is #header (you can see it in the above link where I have applied your css)
The #header element goes from the left side of the monitor to the right side. A position right would position the flags at the right side of the monitor but not within the container which defines the width of the site. This is why I am asking for a hook within the container that contains the logo and defines the max-width of the site. I am quite familiar with css.
The position right: 90px is way outside of the main content region if looking at the site with a larger monitor. Is there a hook reference somewhere? What hooks are available WITHIN THE CONTAINER of the header region?- This reply was modified 9 years, 2 months ago by bluecafe.
October 20, 2015 at 5:21 am #521355Hi,
You can try these two or edit helper-main-menu.php in enfold/includes
ava_main_header ava_after_main_menu
Best regards,
RikardOctober 20, 2015 at 8:00 am #521425I have already used these hooks and the are NOT whithin the inner container. Can please anybody answer my question if there are any hooks within the inner header container who knows about theme hooks? Thanks
October 21, 2015 at 4:08 am #522116Hi,
ava_after_main_menu is within the inner container, just after navigation. Did you have a look in helper-main-menu.php in enfold/includes? Maybe there is a hook that will suit you better?
Best regards,
RikardOctober 21, 2015 at 8:32 am #522169Hi Rikard, thanks so much for pointing me to helper-main-menu.php.
ava_before_bottom_main_menu is the perfect hook for placing the icons within the inner container and above the main menu. Thanks again. Sorry if I have been a bit grumpy … I just have been stucked on this … very happy now, have a nice day! :-)October 22, 2015 at 5:20 am #522724October 22, 2015 at 2:42 pm #522982Thanks, Rikard. Yes you can mark the thread fully satisfactory resolved :-)
Thanks again …- This reply was modified 9 years, 2 months ago by bluecafe.
-
AuthorPosts
- The topic ‘Adding a header widget to the logo container’ is closed to new replies.