Forums

Migrating Twenty Eleven to a child theme. (5 posts)

  1. luddite2k11
    Member
    Posted 9 months ago #

    Hi all,
    I have just started with WordPress in the last few days and went charging in like a bull at a gate and now realise I probably should have created a 'child theme' instead of using my limited abilities to adapt the Twenty Eleven Theme. I have been designing a largely static website for a friend about a Jazz festival she is organising and it's due to go live asap, so my stupid questions are :

    1 Can I migrate everything I have done to a child theme ( if so how ? ) or do I have to start again ?
    2 Is it true that WordPress update your theme automatically rather than allowing you to decide whether to do it manually ?
    3 Can someone point me to an idiot's tutorial to moving your WordPress site from localhost on MAMP to an external host's server.

    So, not too much to ask (sic), please help me out before I get into any more trouble. :-)

    Cheers, L2K11

  2. peredur
    Member
    Posted 9 months ago #

    1. Yes. Create a child theme folder and copy all the files you've changed to the new folder. Alter the comments block at the top of the child theme's style.css to reflect its status as a child theme. Now go to Dashboard --> Appearance --> Menus. Your child theme should appear on the list of available themes. Activate it and check your site. It should appear exactly as it is. Now you can delete and then reinstall the parent theme (twenty eleven) to get it back to its original state. Finally, check your site. It should look the same
    2. No. You decide.
    3. Moving_WordPress

    HTH

    PAE

  3. luddite2k11
    Member
    Posted 9 months ago #

    Wow, thank you very much. That was incredibly efficient and generous.

    Just to clarify if I may,

    1 Style.css, no problem I understand that. In my stumbling in the dark though I have also altered functions.php and created a new template so I can have an mp3 player widget in the main content, header.php to drop a link div over the top and a different sized header and possibly other things I have forgotten but will have to check.( Yes I know ).
    As a consequence do I need to move the whole Twenty Eleven theme contents into the new folder or just the files I have tampered with and if so do I need to add any lines to the .php files so they take precedence over the Main 2011 theme.
    2 Brilliant thank you. I thought that sounded too Orwellian to me.
    3 Thanks for the link. I have tried to understand this page but I'm still pretty confused. I am also going to have to change the name of my Root folder when I move the site as she hasn't registered the domain name yet and it exists on my computer in a folder called 'WordpressDB'. Am I going to have to change all the internal links ?
    Sorry, this is when I start to struggle.

    Thanks once again for your time.

    Luddite2k11

  4. peredur
    Member
    Posted 9 months ago #

    Just copy all the altered and new files into your child theme folder. You don't need to copy the unaltered ones. And no, you don't need to add anything. WP automatically looks for a relevant file from the child theme first, and if it finds one, it doesn't look in the parent. If it doesn't find one, it looks in the parent.

    For styles, of course, you import the parent's styles into your child theme's style.css file so that all the parent styles are used unless overwritten later in your child theme's style.css file.

    The only exception to this is functions.php. In this case both files are loaded but the child theme's functions.php file is loaded first so that any functions defined in the child theme take precedence over any of the same name in the parent (assuming the parent is child theme friendly and has wrapped all its functions in a test for the prior existence of the function). But on the whole, you're likely to add new functions and not try to overwrite existing ones, I've found, so it doesn't really matter.

    Changing the name of the root folder is the business about changing the site URL.

    Pretty much all WP URLs finish up being absolute URLs (http://yourserver.yourdomain.whatever/yourwpfolderifany/slug) so as long as you've set up the site url and everything correctly (for the new server), it should all be OK. It is confusing. That's why I usually work on the server right from the start if I can, with 'Maintenance Mode' installed to keep users out. If I can't I just set up the structure with some test content, then when I've agreed that structure with the customer I do a fresh install on the server and set up the structure from scratch: only then do I put the real content up (or get the user to do it) - using Maintenance Mode again, of course, until it's ready.

    It saves a lot of hassle.

    When I went on an Advanced WP Course not so long ago, the instructor demonstrated moving a site and finished up failing miserably.

    HTH

    PAE

  5. luddite2k11
    Member
    Posted 9 months ago #

    Brilliant. It is very encouraging to find someone who can explain things so clearly. I have a much better idea of the way things are structured now.

    I was brimming with confidence right up until you said "When I went on an Advanced WP Course not so long ago, the instructor demonstrated moving a site and finished up failing miserably." !! :-}

    Thank you sincerely, I will mark this thread well and truly 'resolved'.

    All the best, L2k11

Reply

You must log in to post.

About this Topic