• Koesterandersen

    (@koesterandersen)


    I am about to make a homesite in wp, and I have already read a lot of manauals i the codex and a few other places.

    There is one thing, where I still have some doubts. If I for example use the theme twenty fourteen, then the page template of that theme has an area for text content at 472 px in the width. If I want to keep this template with that specific area, but in the same time want another page template with a text content area at 600 px in the width, will I then have to first make a child theme and after that then make the new page template.

    As I see it so far, I will have to start with the file functions.php in which the 472 width is set. When I do not want to alter the width for the existing page template, I have to make a new functions.php and put it in a child directory and then change the width. In that child directory I also put a copy of page.php and rename it with a proper filename.

    Am I right so far – and if so, how should I make the connection between the new functions.php file and the new page template file in the child directory in order to have the right width of 600 px at the new page template.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    No need to edit the function.php or any theme files for changing the width of a page. You just need to add some CSS to overwrite the theme’s CSS file to change the width of the page.

    Thank you.

    Thread Starter Koesterandersen

    (@koesterandersen)

    Hi Jitendra

    Thank you for your answer.

    I have found the place in the CSS, where the width of 474 px (not 472 as I wrote in first place) is set. If I just change this to 600 px, then all the pages will get that width, I guess. If I still want some pages to be 474 px and a new page template to be 600 px, how shall I then connect the information in the CSS with the new page template.

    And another thing. If I make changes in the parent CSS, what will then happen with the new settings, when the theme is updated.

    Thank you in beforehand…

    Hello,

    The code you are seeing in your style.css is for the width of pages through out the site. If you need the width of some pages to be of 600px width , then you need to add CSS for only the page. For example:

    .page-id-701 .container {
        width: 600px;
    }

    I am not sure where the width is set there in your site so I have added it to container just for your understanding about how to add width to a single page only.

    If you want that for multiple pages, then you need to repeat this process again and again just replacing the page ID of the page you want to add style. You can find the page ID by using any Development tool like Firebug or Chrome Inspector.

    And regarding your last question, you always need to add your customized codes in your Custom CSS field. If you add it directly in parent css file, then all customizations will reset to default in updates and your site may slow down.

    If your theme supports Custom CSS field, then you need to add your customized codes there, but if your theme does not support Custom CSS field, then you can use some plugins for achieving that or use a Child Theme. Please refer this document for further help regarding this:

    Hope hat helps. Thank you.

    Thread Starter Koesterandersen

    (@koesterandersen)

    Hi

    I think it was the answer I was looking for. Today I am going to practise instead of just reading. Then I will see, if I can make it happen the way I want.

    Thank you very much for your help so far.

    You are most welcome.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Making a child theme before making a page template’ is closed to new replies.