Archived topic
Changing grid sizes without using CSS
5 replies · Started by Pradeep on November 8, 2017
Hello...
I have a developer working on one of my projects and he would like to know if there's a 'non-CSS solution' to change main content from grid-75 to grid-70 and sidebar from grid-25 to grid-30. Please let us know if there's a way for that.
Apologies for posting a totally unrelated question with that. Is there's a place within customizer to assign a custom sidebar to a single post template? Or do we have to edit the single.php with our custom sidebar details?
Many thanks in advance.
Hi there,
You can change the sidebar width in the customizer: https://docs.generatepress.com/article/sidebar-widths/
This plugin should help for page specific sidebar: https://en-ca.wordpress.org/plugins/content-aware-sidebars/
Thanks Leo! My developer is happy first solution.
Is there any way to add the custom sidebar using hooks as I'd rather avoid adding another plugin? This is how we added it:
function pm_single_post_sidebar()
{
if (function_exists('register_sidebar')) {
register_sidebar(
array(
'name' => __('Single Post Sidebar', 'generatepress'),
'id' => 'single-post-side-bar',
'description' => __('Single Post Sidebar', 'generatepress'),
'before_widget' => '<div class="widget-content">',
'after_widget' => "</div>",
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
}
}
add_action('widgets_init', 'pm_single_post_sidebar');
Many thanks in advance.
There's some sidebar related hooks:
https://docs.generatepress.com/article/generate_after_left_sidebar_content/
https://docs.generatepress.com/article/generate_before_left_sidebar_content/
https://docs.generatepress.com/article/generate_before_right_sidebar_content/
https://docs.generatepress.com/article/generate_after_right_sidebar_content/
Thanks Tom! As usual nothing but the best support.
Glad I could help! :)