- This topic has 18 replies, 3 voices, and was last updated 3 years, 8 months ago by
Tom.
-
AuthorPosts
-
August 30, 2018 at 8:53 am #664494
Naman Nepal
Hi,
Is there a way I can setup a navigation/option to display a list of child pages for parent pages after the page header?
Here’s an example of what I meant: https://prnt.sc/koqbjd
Thanks!
GeneratePress 2.1.4GP Premium 1.7.2August 30, 2018 at 10:00 am #664552Leo
StaffCustomer SupportHi there,
Not quite sure if I understand what you mean.
So what would be in the primary navigation?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/August 30, 2018 at 10:08 am #664560Naman Nepal
Hi Leo,
Primary navigation can have anything we want it to be there that we add from “Appearance>>Menus” on WP.
On the nav below the page header, I want to show child pages of the parent page I’m on.
Let’s say we have three pages (Page 1- the parent page, and Page 2 and Page 3- the child pages). I want to show Page 2 and Page 3 in the nav below the page header.
Or, say Page 4 has child pages Page 5, Page 6, Page 7. Then, Page 5, 6, 7 will be in the nav below the page header.
Do you understand now?
August 30, 2018 at 9:58 pm #664911Tom
Lead DeveloperLead DeveloperHi there,
There’s nothing inside GP that will allow you to do that.
How would child pages be defined?
You may need to ask over on https://wordpress.stackexchange.com/ how to get a list of child pages from a parent.
Then you could hook that solution into the theme after the page header like this:
add_action( 'generate_after_header', function() { // The solution in here }, 15 );
Sorry I can’t be more helpful!
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentAugust 30, 2018 at 9:59 pm #664912Naman Nepal
Nice, this helps!
August 31, 2018 at 8:12 am #665317Naman Nepal
Hi Tom,
I had to re-open this again for a simple request again.
I’ve achieved what I wanted to (but had to go with a different layout). I’ve created a sidebar that only shows child pages here. – http://bit.ly/2C20ZMz
For pages with less child pages, the design looks perfect. (Example: https://prnt.sc/kp4pcv)
But for pages with a big list of child pages (and on smaller screen) the body content falls behind the sidebar I created. (Example: https://prnt.sc/kp4ql9)
I’ve set the sidebar to have position: absolute !important;.
How can I avoid the content to fall behind? (I tried setting up the position to relative but that brought the body content up in the header for pages that don’t have child pages).
Any help will be appreciated.
Thanks.
August 31, 2018 at 9:58 am #665413Tom
Lead DeveloperLead DeveloperWhat if you added it inside the content (
before_content
), and then set it to float left instead of absolute positioning it?Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentAugust 31, 2018 at 10:13 am #665421Naman Nepal
Thanks Tom!
This seem to remove the spacing issue. But since my container width is set to 1080px, how do I float it to the left of the whole page and not just the container?
August 31, 2018 at 8:31 pm #665692Tom
Lead DeveloperLead DeveloperThat won’t be easy to keep responsive. Any chance you can link me to what you have so far?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentAugust 31, 2018 at 8:32 pm #665693Naman Nepal
Don’t need it to be responsive. I only want it on the desktop. (Will add class to turn off on mobile and tablet).
How do I get you my details if you want to login and see?
August 31, 2018 at 8:33 pm #665694Tom
Lead DeveloperLead DeveloperYou can send them through an account issue form here: https://generatepress.com/contact
Just be sure to mention this topic π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentAugust 31, 2018 at 8:36 pm #665696Naman Nepal
Just did that. π
September 1, 2018 at 9:21 am #666063Tom
Lead DeveloperLead DeveloperThe problem with doing this is you’ll end up with the nav overlapping the content.
However, if you add a media query to include the container width + the width of the nav, it might work:
@media (min-width: 1300px) { .subpagemenu { position: absolute; left: 0; } }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 4, 2018 at 7:55 am #668479Naman Nepal
This did not seem to work, Tom.
I might have another fix. By setting up a left sidebar and then moving it to left: 0.
I tried doing that but I can’t seem to get the sidebars to the left most of the page. Is there a fix for the sidebars to have left: 0?
September 4, 2018 at 8:54 am #668527Tom
Lead DeveloperLead DeveloperI would actually keep it the way we were trying. Any chance you can change it back and add the CSS I suggested again? I should be able to tell why it’s not working π
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.