• Hello there,

    I am currently using three widgets in the footer section of our website (www.aikidoimhof.de) which I created with Twenty Twenty-One (child theme).

    The widgets work fine, but I would like to align the content of each widget in the center. I managed to align the text of the text-widget in the center, but would like to align both the category post widget and the title of the text widget in the center.

    So far I have tried the following in the custom css section of the customizer, but they didn´t do the trick completely (only aligned the text of the text-widget in the center):

    .footer-widgets {
    text-align: center;
    }
    .widgettitle {
    text-align: center;
    }
    .textwidget {
    text-align: center;
    }

    How can I align the category post content in the center and the header of the text widget? Any help would be very much appreciated. Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator threadi

    (@threadi)

    Just use this code:

    .widget > * {
    text-align: center;
    }
    Thread Starter aikichick2012

    (@aikichick2012)

    Thank you, but it is not working… 🙁 I added your suggestion to the custom CSS in the customizer. Starting to think I am doing something wrong there, but I have added custom css in the past and it worked…

    Moderator threadi

    (@threadi)

    You have entered syntax errors in the field in the Customizer. This causes the browser to skip the code.

    Currently, it says:

    .entry-content > *:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.wp-block-separator):not(.woocommerce) {
    width: 60%;
    max-width: 1240px;
    }

    @media only screen and (min-width: 482px) {
    .site-header {
    padding-bottom: 0px;
    }
    }

    /* Footer Widget area */
    .widget-area {
    margin-top: 0px;
    }


    /* Remove focus style on links */
    .has-background-white .site a:focus:not(.wp-block-button__link):not(.wp-block-file__button) {
    background:unset;
    color:unset;
    text-decoration:none;
    }

    .entry-content > *:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.wp-block-separator):not(.woocommerce) {
    width: 80%;
    max-width: 1240px;
    }

    .footer-widgets {
    text-align: center;
    }

    .widgettitle {
    text-align: center;
    }

    .textwidget {
    text-align: center;
    }

    .footer-box {
    text-align: center;
    }`

    .widget > * {
    text-align: center;
    }
    /

    The correct code would be:

    .entry-content > *:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.wp-block-separator):not(.woocommerce) {
    width: 60%;
    max-width: 1240px;
    }

    @media only screen and (min-width: 482px) {
    .site-header {
    padding-bottom: 0;
    }
    }

    /* Footer Widget area */
    .widget-area {
    margin-top: 0;
    }


    /* Remove focus style on links */
    .has-background-white .site a:focus:not(.wp-block-button__link):not(.wp-block-file__button) {
    background:unset;
    color:unset;
    text-decoration:none;
    }

    .entry-content > *:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.wp-block-separator):not(.woocommerce) {
    width: 80%;
    max-width: 1240px;
    }

    .widget > * {
    text-align: center;
    }

    Pay close attention to the spelling here. One mistake and it will not be interpreted or will be interpreted incorrectly. In my example, I also removed the three details you added, as I don’t think they have any effect.

    If you have a child theme, you can also simply store the code in its style.css.

    Thread Starter aikichick2012

    (@aikichick2012)

    That’s perfect and worked!!! You are a star, thank you so much!!!

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.