I found the “fullwidth-model” to get pages without sidebar. Is it possible to do the same thing for the posts ? I deleted the get_sidebar of the single.php from my child-theme but the post doesn’t take full screen.
Is there any codes to put into the css file ?
It seems to be the good way, but the sidebar appears at the bottom of the home page. I tried to change width pourcent but it still not flash with post contents.
I appreciate your help a lot,
It still not ok, but i have a idea and i want to share it with you to know if it can figure out this issue.
If i change the layout from fullwidth to right sidebar and remove the “get_sidebar” from the single.php file, the sidebar disappear on the posts and stay on the home page, it’s what i want, but, the post doesn’t take full screen, so maybe there is a code to put in the single.php to get fullwidth post ?
Hello,
I’ve found a way to get fullwidth on post…
When editing post, it’s possible to change “layout for this specific post” by “Fullwidth” model. I have a lot of posts so i would find the file.php corresponding to “default” model to change the code by the “Fullwidth” model ? Could you tell me where is this file ?
Thank you
The template used for the blog posts would be template.php. So you can edit that file but I would recommend making a backup before making any changes and use a child theme for the changes:
Yes, i did it, i am working on my child-theme, i can’t find the posts models for : Right sidebar, Left sidebar, no sidebar, Fullwidth
I begin understanding templates : When you create a post, single.php is called then template-parts/Content-single.
Then post is fullwidth if page-fullwidth.php has been called by the function “if_page_template” ?
Which template is called for the posts ? (default)
What about Right,Left and no sidebar ?
I had a look in the post-template and i found this (but, i don’t know how to call “Full-width” model from sparkling’s directories instead of “Default” :
/**
* Get the specific template name for a given post.
*
* @since 3.4.0
* @since 4.7.0 Now works with any post type, not just pages.
*
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
* @return string|false Page template filename. Returns an empty string when the default page template
* is in use. Returns false if the post does not exist.
*/
function get_page_template_slug( $post = null ) {
$post = get_post( $post );
if ( ! $post ) {
return false;
}
$template = get_post_meta( $post->ID, '_wp_page_template', true );
if ( ! $template || 'default' == $template ) {
return '';
}
return $template;
}