Archived topic
Stackable Theme Integration
3 replies · Started by Rafael on January 23, 2023
Hi Generate Press Peeps,
I am about to use Stackable Gutenberg blocks plugin and they have a Theme Integration Guide:
https://docs.wpstackable.com/article/429-theme-integration-guide
Quote:
Theme's Content Width
Some functionality in Stackable uses your theme's content width. To ensure the width is easily detected, make sure you define it in the theme's functions.php file:
global $content_width;
$content_width = 640;<br>
Is this a necessary step with GP and/or what steps do you recommend?
Rafael
Hi Rafael,
I'm not familiar with Stackable Gutenberg blocks plugin so cannot comment on if this is a necessary step.
Can you check with their support team first to see if they can point you in the right direction to determine this?
GP's container width is defined in the customizer:
https://docs.generatepress.com/article/container-width/
Let me know :)
Tech,
Does GP use the following code below to create the container width:
global $content_width;
$content_width = 640;<br>
If GP does, I am assuming that Stackable blocks will be able to see it?
I also posted in the FB group.
Rafael
Hi there,
no GP does not register that global variable.
i don't know why they want the theme to add it....
if you need it then you can add it using this PHP snippet:
add_action( 'after_setup_theme', function(){
global $content_width;
$content_width = 640;
});
This doc explains how to add PHP:
https://docs.generatepress.com/article/adding-php/