• Resolved Moritz83

    (@moritz83)


    Hi there,

    I am using the twenty twelve theme and I really like it but there is a small thing I would like to change:
    I made a few pages conatining slideshows and centered them. Unfortunately I am not able to center the page titles so it is looking a bit weird. Is there a possibility to center the custom page titles by using CSS?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Do you have a child theme or custom CSS (jetpack plugin is a good option) set up? You’ll need to do that first so that your changes are not overwritten when the theme is updated.

    http://codex.wordpress.org/Child_Themes

    Thread Starter Moritz83

    (@moritz83)

    Of course I created a child theme, just don’t know where to change this thing 🙂

    Can you post a link to the page where you want to do this?

    Thread Starter Moritz83

    (@moritz83)

    It looks like you have the entire style.css file in the child theme? That’s not ideal – you should have only changes there. That said, the relevant CSS to center those titles is:

    .entry-header .entry-title {
        text-align: center;
    }

    You may need to make it in the @media queries for bigger screens.

    Thread Starter Moritz83

    (@moritz83)

    working, thanks a lot …. BUT now I have the titles of the frontpage posts centered as well. Is there a posibillity to add a separate entry for the slideshow pages like

    .entry-header .entry-title-slide {
        text-align: center;
    }

    and define an own template for these pages? It’s a bit confusing right now 😉

    Also how can I define the changed line in a separate CSS file and take the rest out of the original one?

    Almost – what you need to do is use the page specific class at the front of the CSS – if you look in the body tag, you’ll see a class for that page:
    So for your motorcycle1 page, it would be:

    .page-id-72 .entry-header .entry-title-slide {
        text-align: center;
    }

    You should remove all the CSS code from your child theme style.css file and only include the changes you’ve made in there. If you’ve already made many, use a file compare program to do so.

    Thread Starter Moritz83

    (@moritz83)

    you really made my day 🙂
    it’s working perfectly!

    so just for my understanding:
    I have to do this (empty file with only the changed lines) only for the CSS files; the PHP files I have to copy 1:1 … correct?

    Yep – you got it. But if you need to modify the functions.php file, that’s different from either of the above, so read the child theme page before messing with that one!

    Thread Starter Moritz83

    (@moritz83)

    I created a new theme called “twentytwelvechild” – empty folder with just a single css file in it.

    /*
    Theme Name: twentytwelvechild
    Template: twentytwelve
    Theme URI: http: //beispiel.de/
    Description: Ein Child für das twentyeleven-Theme
    Author: Hier kommt Ihr Name hin
    Author URI: http: //beispiel.de/mein-child-theme/
    Version: 1.0
    */
    
    @import url('../twentytwelve/style.css');
    
    .page-id-68 .entry-header .entry-title {
        text-align: center;
    }

    Now it’s easier to make changes to the theme. I don’t think I have to make changes to the php files but if so it should be enough to copy the changed file into this folder. WordPress should now ignore the file inside the parent theme folder and use the child one instead (except functions.php stuff).

    Again, thanks a lot for your help 🙂

    Perfect – you’re welcome 🙂 .

    Hi,

    I have created my twenty twelve child theme. I would like to do two things:

    1. Move my main nav bar below the logo and logo further up.

    2. Center the title of my posts.

    Thank you for your help and support. Here is my ‘in progress’ site:

    http://69.89.31.106/~aupetitg

    @apgblog2012 – you need to start your own thread in the theme’s own forum here:

    http://wordpress.org/support/theme/twentytwelve

    scroll to the bottom to start a new thread there.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[Theme "Twenty Twelve"] – Center Page titles’ is closed to new replies.