Post page without sidebar

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 ?

Thank you

Hello there,

I hope you are doing well today.

Please go to Appearance > Customize > Blog Settings > Blog Single Settings and set the template type to full width.

Best Regards,
Support

Hello,
Sorry but i can’t find this option in on the “customizer”, Blog settings or Blog Single Settings doesn’t exist ?
Thank you

Hello there,

Sorry about that.

Please go to Appearance > Customize > Sparkling Options > Layout Options > Website Layout Options and set this to Full width or No Sidebar.

Best Regards,
Support

Ha yes ok, it works but i want keep the sidebar on the home page. Is there a solution to do that ?
Thank you

Hello there,

You can try adding the following CSS to have the sidebar on the homepage:


.home .no-sidebar #secondary, .full-width #secondary {
    display: block;
    float: right;
}

.home div#primary {
    width: 75%;
    float: left;
}

Best Regards,
Support

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.

Hello there,

Try this instead:


.home div#primary {
    width: 73%;
    float: left;
}

If this does not work, then please provide a link to your website so that I can inspect it?

Best Regards,
Support

It doesn’t change and i can’t send you my website link because i work on my local server (lampp) :/. I let you know if i find a solution !

Hey there,

We understand, please let us know if there’s anything else we can assist you with.

Best regards,
Support.

I don’t find any solution, do you have any idea to test ?

Hello there,

Please try adding this CSS to alter the sidebar size:


.home .no-sidebar #secondary, .full-width #secondary {
width: 32%;
}

Best Regards,
Support

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 ?

Thank you

Hello there,

The full width is controlled by CSS mainly but since we cannot see the page it is a bit more difficult to come with more suitable CSS to help.

Best Regards,
Support

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

Hello there,

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:

Best Regards,
Support

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;
}

Hello there,

The full width version of the post is generated by the page.php file.

Best Regards,
Support

I have found a solution,
Juste had to your functions.php on your child-theme :

function sparkling_main_content_bootstrap_classes() {
		if ( is_single() + is_page ()) {
			return 'col-sm-12 col-md-12';
		}
		return 'col-sm-12 col-md-8';
	}

?>

Just one thing to figure out, the images are not fullwidth on my posts/pages, is it possible to figure out this issue ?

Thank you

Hello there,

This will be a bit tricky since I cannot inspect the elements to be sure but please try using this CSS code to increase the image width:


@media (min-width: 992px)
.col-md-8 {
    width: 100%;
}

Best Regards,
Support