Centering a gallery | WordPress.org

Try putting this code in Custom CSS section, it will widen the page title and content section which automatically making them center-aligned.


@media screen and (min-width: 48em) {
	.page-two-column .panel-content .entry-header { float: none; width: 100%; }
}

@media screen and (min-width: 48em) {
body:not(.has-sidebar):not(.page-one-column) .page-header, body.has-sidebar.error404 #primary .page-header, body.page-two-column:not(.archive) #primary .entry-header, body.page-two-column.archive:not(.has-sidebar) #primary .page-header { float: none; width: 100%; }
}

@media screen and (min-width: 48em) {
	.page-two-column .panel-content .entry-content { float: none; width: 100%; }
}

@media screen and (min-width: 48em) { 
.blog:not(.has-sidebar) #primary article, .archive:not(.page-one-column):not(.has-sidebar) #primary article, .search:not(.has-sidebar) #primary article, .error404:not(.has-sidebar) #primary .page-content, .error404.has-sidebar #primary .page-content, body.page-two-column:not(.archive) #primary .entry-content, body.page-two-column #comments { float: none; width: 100%; }
}

It’s worth mentioning that when starting a new project, we’d better use new themes over old ones to better suit the updated WP-core and also for longevity of the project. The new theme (2021) can pretty much display the content any way you want, it’s just a matter of setting it up, doesn’t require editing codes (except in some highly complicated designs).

Thanks for the code.

That new theme 2021 was green and no image so I didn’t think about it. Can you add an image? I can give it a try.

The 2021 theme does not have a header image. I used your code to center. I like the 2017 theme better. Why can’t they have updated core in any theme? No theme should be dated. That seems foolish.

https://dkapphotography.com/

  • This reply was modified 5 days, 17 hours ago by wine4all.

Thanks for all the help. I’ll try another theme at some point.

@wine4all , the code is specific to 2017 theme only.

Themes are software and it can be good for a long time (like around 5-10 years) but not forever, each theme will get updated from time to time (if theme author intends to keep it up) but as WP core constantly gets updated, it will get to the point that some old themes will get retired because its internal coding can’t be made compat with the latest WP anymore.

I recommend asking theme related questions in theme’s own forum linked below

Support forum for 2017 theme
https://wordpress.org/support/theme/twentyseventeen/

Support forum for 2021 theme
https://wordpress.org/support/theme/twentytwentyone/

Post question using the post form down below the page. Browse/search around first, some questions might already be answered.

Can you recommend a theme that has a large header for and image like theme 2017?

I guess 2017 theme is too old and I don’t like theme 2021 at all. There are better ones than that.

Thanks

  • This reply was modified 4 days, 23 hours ago by wine4all.

There are too many themes to choose form, pls take your time browsing around and pick one that suits you the most.

https://wordpress.org/themes/

In case you’re still want to experiment with 2021 theme, there is this plugin that extends its options, the header image option is one on the list titled as background image of the site header (I’ve not tried this myself so I’m not sure if this is exactly what you want).

https://wordpress.org/plugins/options-for-twenty-twenty-one/

Theme 2021 works fine with the plugin…

https://dkapphotography.com/

Thanks

  • This reply was modified 4 days, 22 hours ago by wine4all.
  • This reply was modified 4 days, 22 hours ago by wine4all.
  • This reply was modified 4 days, 22 hours ago by wine4all.
  • This reply was modified 4 days, 22 hours ago by wine4all.

Good to hear that it works out for you!



Source link