Remove sidebar and center Posts?
-
Good evening!
Here is my homepage: http://www.AttackLifeCoaching.com.
Like the headline says I want to remove the sidebar and center the posts. I tried to google for help but it seems that every code is different.
(oh really)I just saved and delete the sidebar.php but my content is on the left.
Also, how can I center the header Image in my posts?I would be really thankful for some help!
-
You shouldn’t be deleting any theme files. First of all, the file is just going to come back the next time you update the theme. Plus, you could generate possible errors if an expected file can’t be found.
The easiest way to remove the sidebar & center the posts is using some CSS. The Baskerville theme doesn’t have a custom CSS option, but Jetpack allows you to add your own custom CSS. Go to Jetpack → Settings to activate Custom CSS, and then you should see a menu option under Appearance → Edit CSS. Click on that menu item, then copy & paste in these rules:
body.single .content { width: 100%; } .sidebar { display: none; }Oh, and add this rule to make the featured image stretch all the way across:
.featured-media img { width: 100%; }CrouchingBruin the hero of the day! It works!
But now I have two other questions.
1. The Headline images in my post seem to stretch out to the same size all the time making it look very crumbly and have this “in your face” feeling.
Check this out to see what I mean: Click
2. The Post headline is aligned to the left how can I center them?
If you can’t answer this don’t worry. You already helped me a lot.
Regards
PhilHi, Phil:
1. The Headline images in my post seem to stretch out to the same size all the time making it look very crumbly and have this “in your face” feeling.
You can alter that last rule by adding a padding property that will add some white space on either side of the image:
.featured-media img { width: 100%; padding: 0 25%; }A value of 25% for that second parameter means to add 25% white space to the left & right of the image. You can change that value as you see fit.
2. The Post headline is aligned to the left how can I center them?
Add this rule:
.single .post-title { text-align: center; }The Headlines are only centered when you actually click on the article.
Is there a way to center them on the home site?Also, I don’t want to change the thumbnails on the homesite. I want to change the overall image header size in the article itself.
Thank you!
Oop, sorry.
To center the post titles on the home page as well as the single post pages, just take off the .single selector:
.post-title { text-align: center; }To change the width of the featured image only on the single post pages, add the .single selector:
.single .featured-media img { width: 100%; padding: 0 25%; }Hello friends!
firstly, sorry for my english.i have the same problem with my “page-without-sidebar”
i need to center the post, but i can’t hidden sidebar, is fixed on the right.
i’ve tried with the code inside my php (page-without-sidebar), but i haven’t results.
WEB: http://www.transportesostenible.com/blog/index.php/funcionamiento-transportista/
Thank’u very very much for your help!!! 😀
-
This reply was modified 9 years, 8 months ago by
antonio1981.
@antonio1981, the problem is that with the theme that you are using, it doesn’t have any classes that indicate what template (for example, page-without-sidebar) that is being used on a particular page. Most themes will call the body_class() function to add class names to describe which template is being used. That makes it easy to write CSS rules which target just those types of pages, but your theme does not call that function.
is not possible if i don’t change the theme?
si hay que meter una función se mete crouching!! 😀
algún tema parecido a Inove y que cuente con plantillas sin sidebar?
i’ve tried with the code inside my php (page-without-sidebar), but i haven’t results.
What code did you try adding to page-without-sidebar.php? Maybe you can add an inline CSS stylesheet in there:
<style> #content { background-image: none; } .porc60 { width: 100%; } </style>The only thing is that you have to be careful if you are making changes to the theme’s files. The recommended way to make changes is to create a child theme and make your change to a copy of whatever file you wish to modify. Otherwise, when you update the theme, your changes will be lost, and you will have to add them back in.
asco de foro….borrame si no lo hago antes yo
no resolvéis una duda y me acusáis de falta el “respecto” a nadie…panda de frikis.
no es por nada de este hilo….pero el administrador que borrará este comentario sabe muy bien a qué me refiero. Espero no volver a saber nada de este gran foro de ayuda. -
This reply was modified 9 years, 8 months ago by
The topic ‘Remove sidebar and center Posts?’ is closed to new replies.