Archived topic
Different layouts to post and pages
6 replies · Started by Joan on March 15, 2017
Hello, this theme is awesome and there a lot of documentation here, i tried to search but i don't found.
Sorry for my english, i will try to explain my problem.
I want have different settings to post pages and content pages.
I want for my normal page this style settings:
http://grupodais.com/wp-content/uploads/2017/03/iwantnormalpages.png
I don't want happens that in my normal page: (this happens when i setup how i want my postpages)
http://grupodais.com/wp-content/uploads/2017/03/idontwantnormalpages.png
I want for my postpage this style:
http://grupodais.com/wp-content/uploads/2017/03/iwantblogpages.png
I don't know if i explain me well,
what i ask is possible?
thanks!
Hi Joan,
Can you set the setting to One Container and try this function here?
add_filter( 'body_class', 'joan_body_class', 100, 2 );
function joan_body_class( $wp_classes, $extra_classes )
{
$wp_classes[] = 'one-container';
if ( is_home() ) {
$wp_classes = array_diff( $wp_classes, array( 'one-container' ) );
} else {
$wp_classes = array_diff( $wp_classes, array( 'separate-containers' ) );
}
// Add the extra classes back untouched
return array_merge( $wp_classes, (array) $extra_classes );
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know.
Hi! thanks for respond the same day!
when i put this code, and set the setting to one container don't happen nothing,
but when i put this code and set separate containers, in the normal pages change to diferent containers but in the post pages it's the same in one container,
i want separate containers to posts pages and same cotainer to normal pages,
thanks!
Edited the code above.
Can you set it to Separate Container and give it another shot?
Let me know :)
Thanks that perfect!
Now with set SEPARATECONTAINERS and the code above i have ONECONTAINER to normal pages and SEPARATECONTAINERS on the post pages, exactly what i want!
But now, how can i give diferrent paddings on normal pages and post pages? sorry but i'm beginner editing wordpress!
thanks!
thanks! i found it!
https://generatepress.com/forums/topic/make-content-padding-different-for-posts-and-pages/
see you!
Glad you found the post :)