• I have managed to create a child theme, albiet very basic (it just has a stylesheet). But say I’ve made changes to the main theme (Twenty Ten) in loop.php and functions.php, and a couple other files – how would I include these in the child theme folder?

    I found this on the WP Codex page….

    Other files

    In addition to files such style.css, functions.php, index.php, and home.php, a child theme can use any type of file full-fledged themes use, as long as that file is properly linked. For example, it can use icons and images that are linked from its stylesheet, JavaScript files linked from the top or bottom of pages, or extra PHP files called from templates or from functions.php.

    So how do I “properly link” my other files?

    Thanks.

Viewing 15 replies - 16 through 30 (of 31 total)
  • Thread Starter dcloud

    (@dcloud)

    I have created a child theme. Nevermind……I will wait until someone can actually help me.

    If your modified files are in the child theme and you are using the child theme, your changes will not be over-written. You do not need to “link to” anything for a properly constructed child theme to work.

    dcloud,

    You need to help others help you. You can do this by doing some work yourself first: just read the documentation carefully.

    The concept and the workings of child themes are simple, and the documentation is plentiful and of good quality. So, take some time to look at it again, and you will see that you will understand better and that others will be then able to help you more efficiently.

    Thread Starter dcloud

    (@dcloud)

    I have read the documentation, but I am not a coder and so none of it makes any sense to me. That’s why I came here to ask my questions. All I want to know is what they mean by “…as long as that file is properly linked.”

    I want to keep the changes I’ve made to the Twenty Ten files, so I don’t loose them with any updates. But I don’t know how to save any other files but the CSS one. That’s why I came here, to ask about this.

    Template: twentyten

    That’s the link! It’s in the header block of the child theme’s style.css file.

    Thread Starter dcloud

    (@dcloud)

    I guess I’ll have to look elsewhere for help.

    It was also pointed out to you in another thread that there is a known bug related to numeric theme and/or theme folder names: https://www.ads-software.com/support/topic/child-theme-not-working?replies=10

    ok let me jump in here and muddy up the waters a bit more.

    Let’s be clear..you made changes to the default Twenty-ten theme on the functions.php page, correct?

    So the easiest way to get those changes into the Child theme would be to
    1) copy the default Twenty-ten functions.php file to a plain text editor
    2) find the functions You Changed in that file
    3) make a new file called functions.php (for your child theme)in the plain text editor and add the functions you changed
    4) upload (ftp) the new functions.php to your child theme folder.

    The above process can be used to save all the changes you have made.
    Don’t remember where they all are..
    then either download the default Twenty ten files to your computer, or copy and paste them from the editor to your computer. (so you can save your changes)

    if you can’t or don’t want to work with child themes, there is another way:

    create a new sub-folder of the /themes folder; name it somehow related to your intended theme name (as you know now, no pure numerical folder name);
    for instance: /wp-content/themes/twentyeleven

    then copy all theme files from the Twenty Ten (which you are modifying), into the new folder;

    then rename the theme in style.css (for instance):

    /*
    Theme Name: Twenty Eleven
    Theme URI: https://www.ads-software.com/
    Description: 2011, based on Twenty Ten, the default theme for WordPress.
    Author: the WordPress team; modified by dcloud
    Version: 1.0
    Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu (optional)
    
    License:
    License URI:
    
    General comments (optional).
    */

    https://codex.www.ads-software.com/Theme_Development
    https://codex.www.ads-software.com/Theme_Development#Theme_Stylesheet

    that is all – you can now edit and modify this theme as you like – it will not be overwritten with any update

    (make regular backup copies of your themes and database)

    That is what I was thinking and trying to explain, but you did a much better job.

    Thread Starter dcloud

    (@dcloud)

    I apologize to everyone. I was getting frustrated. I thank all of you for taking the time to help. alchymyth, thank you for that post. I’m going to give that a try.

    After I do this should I “activate” that theme in the Themes area of my dashboard? And forgive me if this sounds dense, but will the new theme keep the changes on the site even if I have to update the original theme?

    Thread Starter dcloud

    (@dcloud)

    Also if I do create my own theme off the original will the updates to the original theme have any effect on the one I created? I’m just wondering if the created theme will update along with the original.

    Thread Starter dcloud

    (@dcloud)

    Hello?

    If your new theme is a child of the original, your customisations will be preserved when upgrading the original but you should be able to take advantage of any new theme functionality.

    If your new theme is a standalone theme, it will not be affected in any way by any updates in the original theme.

    Okay so I copy header file from 20-10 to my child theme … I have an image in my child theme image folder however that I can’t seem to get to …

    If I use <?php echo bloginfo ('template_directory');?> as suggested above I wind up in 20-20 image folder and not in the child theme image folder … what am I missing?

Viewing 15 replies - 16 through 30 (of 31 total)
  • The topic ‘Adding other files to a child theme?’ is closed to new replies.