- This topic has 5 replies, 2 voices, and was last updated 7 years, 4 months ago by
Tom.
-
AuthorPosts
-
October 31, 2015 at 3:54 pm #149243
Dennis
Hi there,
I want the page header to be only over the content box and not over the content box _and_ the sidebar. I know that I can configure the page header image to be shown right above the content, but then I do not have a standalone image box anymore.
Here a is a good old ASCII art of what I want:
***PAGE HEADER*** | ***SIDEBAR*** | ------------------| ***SIDEBAR*** | ***CONTENT*** | ***SIDEBAR*** | ***CONTENT*** | ***SIDEBAR*** |
And what I don’t want:
*************PAGE HEADER*********** ----------------------------------- ***CONTENT*** | ***SIDEBAR*** | ***CONTENT*** | ***SIDEBAR*** |
Thanks for your help.
October 31, 2015 at 4:10 pm #149246Tom
Lead DeveloperLead DeveloperHi Dennis,
Nice ASCII art π
Set your position to below the header, and then try this function:
add_action( 'wp','generate_move_page_header' ); function generate_move_page_header() { remove_action('generate_after_header','generate_page_header', 10); add_action('generate_before_main_content','generate_page_header', 0); }
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
Let me know if that does the trick or not.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 1, 2015 at 5:35 am #149489Dennis
Hi Tom,
thanks for the quick reply!
I created a child theme and added your code to the functions.php. Now the page header is where I want it to be, but there is no gap between the page header and the content.
I think my ASCII art wasn’t precise enough. π
There should be a gap between all the containers, so let me try again.
| |----------------- | |---------------| | | |----------------- | |---------------| | | |***PAGE HEADER*** | | ***SIDEBAR*** | | | |------------------| | ***SIDEBAR*** | | | |------------------| | ***SIDEBAR*** | | | |***CONTENT*** | | ***SIDEBAR*** | | | |***CONTENT*** | | ***SIDEBAR*** | | | |***CONTENT*** | | --------------| | | |***CONTENT*** | | --------------| | | |***CONTENT*** | | ***SIDEBAR*** | | | |***CONTENT*** | | ***SIDEBAR*** | | | |***CONTENT*** | | ***SIDEBAR*** | | | |***CONTENT*** | | ***SIDEBAR*** | | | |***CONTENT*** | |---------------| | | |***CONTENT*** | |---------------| | | |***CONTENT*** | | | |***CONTENT*** | | | |------------------| | | |------------------| |
Thanks in advance!
Dennis
November 1, 2015 at 11:00 am #149518Tom
Lead DeveloperLead DeveloperTry adding this CSS as well:
.page-header-content { margin-bottom: 20px; margin-right: 20px; margin-top: 0; } @media (max-width: 768px) { .page-header-content { margin-right: 0px; } }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 1, 2015 at 2:57 pm #149586Dennis
Thanks for the hint!
To make it work I added
.separate-containers .page-header-image { margin-top: 0px; margin-bottom: 20px; } @media (max-width: 768px) { .page-header-content { margin-right: 0px; } }
I don’t know if this is good style but everything seems to work fine.
November 1, 2015 at 8:34 pm #149628Tom
Lead DeveloperLead DeveloperLooks good to me π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.