Support » Fixing WordPress » Coding in Child Theme?

  • We are using the twenty twelve theme.

    To be able to post to a static page I made a new template file called pages-your page.php. An author would choose that template when making a post to the static page “Your Page” Then they would have to choose the “Author” category with an ID of 7.
    To prevent posts on that page from displaying on the blog page, I used a statement in the index.php to exclude certain category IDs. In this case 7.

    Now I don’t know how to modify the Child Theme’s CSS to prevent all of the above from being undone once the next WP update comes out.

    If I just simply modify the existing file(s) and then do an update I’ll have to repeat the process again and again.

    Could someone guide me in making this modification?
    The site is still raw but the URL is here.
    Thanks a heap.

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you are making these file changes in your child theme, you won’t have any problems when you update. Are you putting the changed or new .php files in the child theme folder? They’ll be safe there – the CSS has nothing to do with that.

    Thread Starter SDavenport

    (@sdavenport)

    Oh! very good. The new file I would understand, but what happens when the updated version of index.php comes along? Will the child theme continue to use the one in it’s folder? In my case I have a static front/home page and a blog page for posting, “My Page.php”

    Or should I just put the “My page.php” in the child theme folder too?

    Thanks

    Any php file that you want to change, make a copy of the parent file and move that to your child theme – and then make the changes there. The child theme version takes precedence over the parent when the file names are the same. And put any additional, new php files only in the child theme too.

    Thread Starter SDavenport

    (@sdavenport)

    Thank you for your help. I just realized that the index.php file was probably not the correct place to exclude categories form posting if my blog page is one I created and named “My Page”.

    Now I need to figure this one out.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Coding in Child Theme?’ is closed to new replies.