Archived topic
Widget per page
8 replies · Started by Ohad on September 24, 2017
Hello,
Is there any option to select a specif widgets to show specifically for one page / post / or custom post type?
for example,
I have a contact us page (contact form 7),
And i want only a Text widget in the side menu..
is this possible?
Best Regards,
Hi there,
This plugin should do the trick: https://wordpress.org/plugins/content-aware-sidebars/
Let me know :)
Hey Tom,
is this plugin is good for the main blog page?
And if not,
is there any way to set a different blog layout for specific language (via Polylang plugin)?
for example:
English: content > sidebars
Hebrew: sidebars > content
You could use the generate_sidebar_layout filter: https://docs.generatepress.com/article/sidebar-layout/#using-a-function
Something like this:
add_filter( 'generate_sidebar_layout', 'tu_rtl_sidebar_layout' );
function tu_rtl_sidebar_layout( $layout ) {
if ( is_rtl() ) {
return 'left-sidebar';
}
// Or else, set the regular layout
return $layout;
}
Thanks Tom,
That did the trick :)
Hey Tom,
is there any way to limit this change, only to the Blog Page?
Cause now, is see the left side bars in all my pages, and i want it only to the blog...
Try this:
add_filter( 'generate_sidebar_layout', 'tu_rtl_sidebar_layout' );
function tu_rtl_sidebar_layout( $layout ) {
if ( is_rtl() && is_home() ) {
return 'left-sidebar';
}
// Or else, set the regular layout
return $layout;
}
Thank You Tom :)
Glad we could help! :)