Site logo

Archived topic

Position primary navigation above left and center columns, but next to right.

5 replies · Started by Bob on January 6, 2020

Viewing posts 1–6 of 6

I'd like to position the main navigation below the header, above the left sidebar (on pages it appears on) and above main content area, but next to the right sidebar. In other words, the right sidebar would touch the header, but on the left, the nav would come below the header and content. The generate_before_main_content hook will let me get it to the top of the main content area, but that doesn't help with having it extend through the left sidebar.

I know this can be done through custom templates; for example, I could stick to content/right layouts and create my own left sidebar area in order to get the control I need. But I'm wondering if there is a better way to do it within GeneratePress?

Hi there,

do you have a mockup / diagram of what you're trying to achieve? As I am having trouble picturing this.

Hi there,

Give this PHP a shot:

add_filter( 'generate_navigation_location', function() {
    return 'custom';
} );

add_action( 'generate_before_main_content', function() {
    generate_navigation_position();
} );

Let me know :)

That gets the nav into the top of the main center column (above About Us in the mockup) but I'd like it to span the left and center columns.

Can you link us to the actual site so we can see what CSS is now required.

This archived topic is closed to new replies.