Archived topic
Position of a sidebar widget
7 replies · Started by Petar on December 24, 2022
Hello, I've created a sidebar widget with a hook. The goal is to place some SEO text showing only on the index page. I did that but now I have few questions
1. How to position it before other sidebar elements, to be the first one on the top?
2. There is an H1 tag. But because of it, the whole section is too wide. I was wondering is it possible to make that h1 to look smaller without affecting other H1 tags used on regular pages.
thanks
Hi Petar,
1. How are you adding this widget currently? If it's through a Block Element, change the hook to before_right_sidebar_content.
2. Can you check if the settings in Customize > Layout > Sidebars work?: https://docs.generatepress.com/article/sidebar-widths/
#1 - solved. thanks
#2 - I can do that but then other elements on the site will be out of order. Would it be possible to affect size of H1 font but only in this widget, no elsewhere on the site?
thanks
#2 Try this CSS:
.sidebar h1 {
font-size: 20px;
}
Adding CSS: https://docs.generatepress.com/article/adding-css/
private updated
The code provided by Leo shouldn't be causing that. You have this custom code which is removing the padding for that:
.generate-columns .inside-article {
padding: 0 0 15px;
}
You can address this by adding this custom CSS:
.generate-columns .inside-article > :is(header, .entry-summary) {
padding-left: 10px;
padding-right: 10px;
}
thanks
You're welcome, Petar!
