Site logo

Archived topic

Move Widgets Above Blog Archive Content

7 replies · Started by Becky on April 2, 2020

Viewing posts 1–8 of 8

I would like to move the categories and search bar above the post content on the blog archives page. Currently there are only left/right/no sidebar options. Is this possible to do?

Hi there,

Give this CSS a shot:

@media (max-width: 768px) {
    .site-content {
        display: flex;
	flex-flow: row wrap;
     }
    
    #right-sidebar {
	order: 1;
    }
    
    .content-area {
        order: 2;
    }
}

Adding CSS: https://docs.generatepress.com/article/adding-css/

Let me know if this helps :)

Hmmm, no luck with that CSS...

Not seeing it being added at all.

Can you double-check? Make sure to clear caching plugins if you are using any and leave the CSS in even if it's not working.

Oh whoops! Yeah I deleted the CSS after inspecting. Just re-added, and realized I did not check on mobile. I see it works on mobile! Any way to achieve the same for larger screens? If possible, I am trying to have the categories aligned left to right versus vertically. Thank you for your help!

If you also want it for the desktop view, then I would recommend using a plugin like this:
https://en-ca.wordpress.org/plugins/widget-shortcode/

Then you can insert the widgets as shortcode using a hook element with after_header hook:
https://docs.generatepress.com/article/hooks-element-overview/

Then you'd still need to add some CSS to style it so they are in one line.

Another solution is to use the secondary navigation to display all the categories:
https://docs.generatepress.com/article/secondary-navigation-layout-overview/

Great, I will check out those options. Thank you!

No problem :)

This archived topic is closed to new replies.