I created a few templates, and I need all of them to be full width. In the functions.php, I found where it’s defining the width, and inserting bootstrap classes for the full-width template. So in my child functions.php I created this:
/**
* Set the content width for full width pages with no sidebar.
*/
function ofsd_content_width() {
if ( is_page_template( 'page-aes.php' ) ) {
global $content_width;
$content_width = 1008; /* pixels */
}
}
add_action( 'template_redirect', 'ofsd_content_width' );
if ( ! function_exists( 'ofsd_main_content_bootstrap_classes' ) ) :
/**
* Add Bootstrap classes to the main-content-area wrapper.
*/
function ofsd_main_content_bootstrap_classes() {
if ( is_page_template( 'page-aes.php' ) ) {
return 'col-sm-12 col-md-12';
}
return 'col-sm-12 col-md-8';
}
endif; // sparkling_main_content_bootstrap_classes
I hope you are well today and thank you for your question.
Please try replacing your above shared code with the following code and make sure you have created the template file page-aes.php in the root directory of your child theme.
/**
* Set the content width for full width pages with no sidebar.
*/
function ofsd_content_width() {
if ( is_page_template( 'page-aes.php' ) ) {
global $content_width;
$content_width = 1008; /* pixels */
}
}
add_action( 'template_redirect', 'ofsd_content_width' );
/**
* Add Bootstrap classes to the main-content-area wrapper.
*/
function sparkling_main_content_bootstrap_classes() {
if ( is_page_template( 'page-fullwidth.php' ) || is_page_template( 'page-aes.php' ) ) {
return 'col-sm-12 col-md-12';
}
return 'col-sm-12 col-md-8';
}
Along those same lines, I have multiple templates. I’m fairly new to php, so is it possible to: if ( is_page_template( ‘page-aes.php’, ‘page-ofhs.php’ ) ) {
or