Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPress子テーマとは?長所、短所、その他

WordPressの子テーマ」-おそらく耳にしたことがあるキーワードだと思いますが、あなたのサイトにとって実際にはどのような意味があるのでしょうか?多くのWordPressユーザー、特にWordPressを始めたばかりのユーザーは、子テーマを使うべきかどうか迷っています。

長年にわたり、私たちはWordPressのすべての規模のサイトを数え切れないほど扱い、全くの初心者からベテランの開発者まで、さまざまなユーザーと話してきました。この経験を通して、私たちは子テーマをいつ、どのように使えば効果的なのか、私たちなりの見解をまとめました。

このガイドでは、専門用語を使わずにWordPressの子テーマとは何かを説明します。子テーマがあなたのサイトに適しているかどうかを判断するのに役立ちます。

What is a WordPress Child Theme? Pros, Cons, and More

以下にトピックを挙げますので、興味のあるトピックに飛んでください:

WordPressの子テーマとは?

WordPressでは、子テーマは親テーマとも呼ばれる別のWordPressテーマの機能、特徴、スタイルを継承します。

子テーマをカスタマイズしても、親テーマは影響を受けません。そのため多くの開発者は、親テーマが更新された場合に失われる可能性のあるテーマのカスタマイザーを保持するために子テーマを使用しています。

子テーマを作成する最初のステップは、良い親テーマを選ぶことです。どのWordPressテーマでも親テーマとして使えますが、より適したテーマもあります。

例えば、テーマフレームワークは優れた親テーマになる。テーマフレームワークは、テーマのコア機能を含むが、スタイリングは含まない。

特に代理店やフリーランサーが複数のサイトに携わる場合、開発時間を大幅に短縮できることがわかりました。

Genesis theme framework

また、サイトが目的を達成するために必要な外観やカスタマイザー機能を備えたテーマを選ぶのも良いでしょう。そうすれば、何度も変更する必要がなくなります。

子テーマを使用することに興味がある場合は、WordPressで子テーマを作成する方法についてのガイドをお読みください。

なぜWordPressの子テーマを使うのか?

前述したように、多くの開発者はWordPressの子テーマを使用して、テーマの更新時にカスタマイズオプションを保持します。この場合、親テーマは更新されますが、アクティブな子テーマには影響しません。

言うまでもなく、子テーマはWordPressの潜在的なセキュリティ問題からサイトを守ることができます。親テーマの更新で重大なバグが見つかっても、子テーマには影響しません。

Theme updates

開発者にとっても、子テーマの使用はWordPressサイトをカスタマイズするための迅速かつ効率的な方法です。親テーマのコアファイルを変更することなく、カスタマイザーやテンプレートの変更、追加機能を素早く実装することができます。

WordPress子テーマの長所と短所

たいていのことがそうであるように、WordPressの子テーマを使うことにもメリットとデメリットがあります。まずメリットを見てみましょう。

WordPress子テーマのメリット

  • 安全な更新:子テーマを使用することで、カスタマイザーの変更はすべてメインテーマから区切られます。つまり、カスタマイザーは子テーマに安全に保存されるため、カスタマイザーを失うことなく親テーマを更新することができます。
  • 拡張が簡単:強力なテーマフレームワークの上に構築された子テーマは、多くのコードを書くことなく、非常に多くの柔軟性を可能にします。カスタマイズしたいテンプレートファイルや関数を修正するだけです。
  • フォールバック・セーフ:完全なテーマを作成する際には、あらゆる可能性を考慮する必要があります。子テーマでコード化されていないものがある場合、フォールバックオプションとして親テーマの機能が利用できます。

WordPress子テーマのデメリット

  • 学習曲線:特に、独自のフィルターフックやフィルターを備えた堅牢なフレームワークを選択した場合は、親テーマについて学ぶのに時間を費やす必要がある。しかし、一度親テーマを知れば、すぐにカスタムサイトを作成できるようになる。
  • 親テーマ依存:親テーマの開発者がテーマを放棄する可能性がある。技術的には、放棄されても使い続けることはできますが、うまく機能しない可能性があります。また、Genesisのような実績のある評判の良いテーマフレームワークを使うことも検討しよう。

子テーマを使うことの長所と短所は、親テーマとして使っているテーマによっても変わってくるので、次にそれを見てみよう。

良い親テーマを選ぶことの重要性

良い親テーマを選ぶことが重要な理由は、時間を節約するためである。

初心者の方で、あまり機能のない親テーマを選んでしまったという失敗談をよく耳にします。彼らは結局、親テーマファイルのほとんどを上書きしなければなりません。

親テーマを選び、フッターの見た目が気に入らないと決めたとしましょう。そこで、新しいfooter.phpファイルを作成します。次に、ヘッダーの見た目が気に入らないと思い、header.phpファイルを新規作成します。

Template Files Used in a Theme

やがて、そのテーマを親テーマとして使うべきではないことが明らかになる。その代わりに、このテーマをスターターテーマとして使い、自分のカスタマイザーにすることもできる。

もう一つのオプションは、あなたが必要とするものにもっと近い別のテーマを選択することでしょう。そうすれば、子テーマに多くの変更を加える必要がなくなる。

WordPressの子テーマを使うべきか?

WordPressサイトの構築と保守に長年携わってきた私たちは、子テーマが最も有益なのはどのような場合かについて、十分な感覚を身につけてきました。ここでは、どのような人が子テーマの利用を検討すべきかをご紹介します。

もしあなたが開発者なら、クライアントと仕事をするときや独自のテーマを作成するときに、子テーマを使って開発時間を短縮することができます。

開発者は質の高いテーマを作成する一方で、ワークフローを効率化する必要がある。子テーマを作成することは、多くの場合、それを達成するのに役立ちます。

私たちが構築するサイトの多くは、Genesisテーマフレームワークの子テーマです。しかし、プロジェクトが非常に複雑な場合や非常にシンプルな場合など、単独のカスタムWordPressテーマを構築する場合もあります。

ユーザーであれば、テーマのfunctions.phpファイルに新しい関数を定数追加したり、style.cssファイルを定数変更したりする場合のみ、子テーマをお勧めします。

WordPressミートアップのトークで、ある読者からカスタムスタイルを追加するための最適なソリューションについて質問を受けました。彼らは、子テーマを使うのがいいのか、カスタムCSSプラグインを使うのがいいのか悩んでいた。

その答えは、あなたがどれだけテクノロジーに精通し、慣れているかによって異なる。また、どれだけのカスタマイザーをするかにもよる。

CSS HeroのようなカスタムCSSプラグインは、いくつかの要素のスタイルを変更するだけなら問題なく機能します。しかし、例えば配色全体を変更するのであれば、間違いなく子テーマの使用を検討すべきです。

Creating a shadow effect in CSS Hero

もう一つのオプションは、WPCodeを使用することです。このプラグインを使うと、コードを直接編集することなく、functions.phpファイルやその他のテーマファイルに変更を加えることができます。

そうすれば、カスタマイザーを失ったりサイトを壊したりする心配なしに、ヘッダーやフッターのスクリプトを実行できます。詳細については、WordPressでカスタムコードスニペットを使用する方法についてのガイドを参照してください。

WPCode Pro version

初心者に優しい、子テーマを使う代替案

WordPress初心者の方には、いきなり子テーマを作成することはお勧めしません。私たちの経験では、子テーマの作成は必要ないことが多く、物事を複雑にしすぎる可能性があります。

その代わりに、私たちが提案するのはこうだ:

  • WordPressを初めて使う場合: フルサイトエディターでも テーマカスタマイザーでも、テーマのビルトインカスタマイズオプションを使うことから始めましょう。最近のテーマの多くは、コードを触ることなく広範囲なカスタマイズが可能です。
  • より広範囲な変更には SeedProdのようなページビルダープラグインの使用を検討してください。これらのツールは、コーディングの知識を必須とせずに高度なカスタマイザーを提供します。
  • ちょっとしたスタイル変更テーマカスタマイザーまたはフルサイトエディターのAdditional CSS機能を使用してください。これにより、子テーマを作成することなく、小さなスタイル調整を行うことができます。

また、あなたのスキルレベルに関係なく、私たちは常にステージングサイトを使用することをお勧めします。ステージングサイトを利用することで、カスタマイズを試したり、新しいプラグインをテストしたり、さらにはライブサイトを壊してしまう心配なしに異なるテーマを試すことができます。

このチュートリアルで、WordPressの子テーマとは何か、子テーマを作成することがあなたに適しているかどうかを学んでいただけたなら幸いです。無料のWordPressテーマとプレミアムWordPressテーマの比較ガイドや、WordPressテーマを変更する前にやるべきことのチェックリストもご覧ください。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

アバター

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

105件のコメント返信を残す

  1. Syed Balkhi

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jiří Vaněk

    I have considered child theme to be a necessity for some time. Although I used to mainly use the WPCode plugin, sometimes it is necessary to insert some code into function.php as well. I’ve found it very helpful to use a child theme so that I don’t end up losing all my customizations just to update the template. In addition, I use a very simple plugin for this, which allows me to insert personal data into the template. It looks much better when the customer sees a template named after their website in their wordpress.

  3. Moinuddin Waheed

    Thank you so much wpbeginner for clearing my doubts regarding child themes.
    I have always used the parent theme for creating websites and blogs and have never used child theme as I was of no clue about how a child theme works.
    I have a small doubt though. Having a child theme and making large changes in its functionality and changing in functions.php and styles.css, where does all these files gets stores?
    as when we update parent theme it remains intact and to my surprise it gets pushed to the parent theme as well.

    • WPBeginner Support

      Those files would be stored in the child theme’s folder. Child themes use the styling of the parent theme and override with any specifics that you include in the child theme but the child theme does not make direct changes to the parent theme if you decide to change to the parent theme.

      管理者

  4. Arischvaran Puvanesvaran

    Hi! Thanks for the tutorials. How should I determine when to use a FSE theme or a block theme for a site?

    • WPBeginner Support

      There is no guaranteed better between the two, it is a question of personal preference :)

      管理者

  5. Bob Scarborough

    What happens if I’ve already created custom headers and footers and then I create a child theme,

  6. DAVID Barnes

    Please could you tell me we have just added a child theme to our theme whilst making changes to the style of the website, when this is complete do you keep the child theme active or do you revert back to the main template and make this active again.
    Hope this makes sense

    • WPBeginner Support

      You would want the theme that you customized to be the active theme. That would normally be the child theme that you customize.

      管理者

      • David Barnes

        Amazing thank you for the quick response this has to be the best website in regards to all word press related topics, it has been a gold mine of information as I navigate my way through the learning process of webdesign. VInaka

        • WPBeginner Support

          Glad we could help :)

  7. Anchal

    Hey I have a question. Does making and activating a child theme affect (drop) SEO ranks of an already ranking website that is live?

    • WPBeginner Support

      It would depend on the specific changes but it should not affect your site’s SEO for the most part.

      管理者

  8. Adam

    Hi, Great article on child themes. It’s exactly what I needed. Just one question? Am I right in thinking that you don’t have to install the child theme when you initially install the parent theme? That you only install it the instant you need to customize the function.php or parent theme template files?

    • WPBeginner Support

      Correct :)

      管理者

  9. Robert A Lopez

    Question! When activating a parent theme and a child these, do I activate both themes in my dashboard? Or do I just activate the child theme and leave the parent theme deactivated?

    I ask because, if I activate both, will I be able to determine which one is the child theme within the dashboard?

    • WPBeginner Support

      You would want to activate the child theme and leave the parent theme deactivated. The child theme will use what it needs from the deactivated parent theme :)

      管理者

  10. Shamsher Ali

    Create content you have shared, thank you for this. I have a question that How can I identify whether the theme is paid or nulled? Would you please tell any legit idea or assistance. Thanks again!

  11. Jeffrey Efosa

    Hi, thank you so much for this informative post. I’d like to confirm my doubts. I created a wordpress site some months back and have not known about child themes until now. However, I have not made changes to the theme files directly but have made a lot of changes with the themes’ Customize. My question is, will I lose my changes when I update my current theme? Thanks in advance.

    • WPBeginner Support

      Unless your theme states there will be an issue with the settings, there shouldn’t be any issues.

      管理者

      • Jeffrey Efosa

        Alright. Thank you much!

  12. Alice

    Hello!
    I’ve started with a child theme with only a few overridden parent files, but now I ended with more customizations than I thought. How is the website loading time affected by having more and more files in my child theme?
    Thanks,
    Alice

    • WPBeginner Support

      That would heavily depend on the files and what they change, there is no specific amount that is guaranteed to change.

      管理者

  13. Simon

    Hi!

    Let’s say I created a child theme of a parent Astra theme. If I want to change something inside Customizer (not theme editor) do I have to use child theme or parent theme? In other words – when I have a child theme, then I only operate with a child theme and leave parent theme deactivated or not?

    Thank you!

    • WPBeginner Support

      When using a child theme you would make any changes using the child theme and not reactivate the parent theme.

      管理者

  14. Brandon

    Hey, and nice article. I’ve been making websites with child themes for the past few years. Now I just came to a realization that the parent theme I’ve been using hasn’t been updated in 2 years. So it seems that the developers have abandoned it. I was just wondering how big are the risks with these sites I’ve made since there are no updates on the parent theme? Will a big WordPress core update break the theme etc?

    • WPBeginner Support

      Sadly, there is no easy way to test that, if you are concerned you can create a staging site to test how an update would be handled.

      管理者

  15. ryad

    hi when i use a child theme and the time to update has come ,do i need to activate the parent theme befor updating or do i update the with the childtheme activated ?

    thank you

    • WPBeginner Support

      You would update the ones that have an update available and you do not need to activate the themes you are updating.

      管理者

  16. Arnolfo

    I’m kinda confused between when I should use a child theme.

    I have a large scale template loaded in WP. I want to customize it to serve as a small scale template for heating/cooling dealers.

    I’m not changing the underlying css code – just swapping out images and text that is more HVAC related..

    Would it make sense to make this a child theme of the original template or if a dealer orders a site make the dealers site the child sites?

  17. Emmanuel

    Hello, please i want to remove media query from my theme so that i can have no problem using jet-pack mobile theme. my theme name is CHURCH AND EVENT. i cannot find media query so i could remove it. i want to disable responsive in my theme. kindly help me out. thank you,

  18. Jody Heath

    I’m all for child themes when absolutely need. The theme I’m currently using, however, offers enough customization, though, I haven’t needed to create a child theme. Usually… if you are thinking about a customization, and you think you need to get into the Dashboard > Appearance > Editor > …. well consider this: If you made change in the Editor, you would lose those customizations every time the theme updated; hence, then need for a child them. But before you go down either road, do a google search and see if you can accomplish your same goal within your actual theme customization options which would be the simpler and preferred option (if available).

  19. Jane

    Hi,
    Sorry, I still dont get it, but i really want to. I dont get parent child relationships here. So I bought a theme, it comes with parent and child theme. I will be doing some css updates for sure, so i should be doing this to a child theme <- so far so good.

    What is confusing for me is the update part. So when update comes in, what do i do? I update parent theme and it doesn't touch the child theme and child theme gets the updates too magically? Or i update child theme and it somehow avoids touching the main files? Or i treat it like dev/live environment where i copy functions from one another? Do I need to install both parent and child theme? I have never dealt with this before, sorry if this is like 2+2 type of question.

    • WPBeginner Support

      Hi Jane,

      1. You will apply your custom css to child theme.

      2. You will get updates for the parent theme. When you update a parent theme your child theme only inherits the changes that are not over written in the child theme. For example, your child theme custom css will not change and any changes you made to the code in the child theme will remain intact.

      管理者

      • Jonson

        Thank you for the Article and the reply. Even I had the same doubt.

        • WPBeginner Support

          Glad we could make it clear :)

    • Paul

      Hi Jane,
      You might think of it as a little like an outfit.
      Your child theme might be like a favourite sweater you pull on over skirt and blouse (parent theme): if you change the skirt and blouse for pants and shirt (update parent theme) then you can still pull on your favourite sweater to keep the “look” you wanted to have.

  20. Daniel

    You say that child themes aren’t necessary, when you’ve only made minor changes. Since it is always vital to update your theme, isn’t it better to always have a child theme, even if you have only made a minor change? I mean, why should you loose your (even minor) change, every time you install a new update?

    • WPBeginner Support

      Hi Daniel,

      Minor changes like custom CSS added using Customize are not affected by theme updates. If you have changes made to actual theme files, then it is better to use a child theme.

      管理者

  21. Cristal Lawrence

    3. How would you respond in this situation?

    Context: In order to administer a WordPress site, the site owner must log in. When logged in, WordPress makes the log in button disappear. i.e log in is only visible for visitors who are not already logged in. Some people don’t realise this and look at their site (when logged in), and then look at the theme demo (when not logged in), pick up on the difference and see the missing login button as something which needs to be fixed.

    The customer submits this support request:

    I am using your theme for my website and while I’m editing it
    I can’t see the Log In button which I see on your theme demo
    site on my page.

    I have followed all your instructions and installed the dummy data and
    believe this should be working.
    I paid good money for this theme and expected that it would be easy
    to install the dummy data and get my site looking exactly as the demo
    for launch next week, and frankly, I’m a little disappointed.
    Please fix this for me.

    • Aharon Smith

      It sounds like they are worried that there is not a way for people to log into the site, vs not having the theme look exactly as the demo. I would explain to them that once they are logged in, that button disappears. I would then tell them the benefits of that feature, such as having a less cluttered website, etc.

      If they are still upset about it, Explain that you appreciate the feedback and you will ensure that in the future you make things clearer on the website. I would suspect that they will be ok with it, once they understand the reasoning behind why the button disappears.

  22. Alex

    Hi there,
    WP beginner here. So let me know if I got this right:
    If I have set up the Divi theme, but I have tweaked certain elements within the theme – like button outline colour, font colours, hover colours – all within the boundaries of the given Divi UI – do I need to think of creating a child theme for future update scenarios? Or would tweaks like these be inherited in future updates with no further hassle?
    No custom css added, nore did I meddle with php on the mentioned project.
    Thanks!

    • WPBeginner Support

      Hey Alex,

      Tweaks like these will be supported by the theme, as they are part of the theme’s functionality.

      管理者

  23. mummygeek

    I am using a child theme and if I’m making changes to any files then I make sure those edited files are in the child theme with the same path (at least I think that’s what I’m meant to be doing.) However now that I come to update the theme on my LIVE site I don’t see what I should now do with the child theme since the update parent theme also has a child theme. Surely the older my original child theme files get the more and more different it becomes to the updated parent theme files until one day it all breaks.
    I’m not clearly seeing how to treat my child theme as I do updates ??

  24. Waqar Ahmed

    Really Informative Information as always.

  25. Apap

    Hello engineer Syed,
    I am reading this post for the third time, and it served me well because I am seriously in need of good theme for my blog, but my problem is that I am a complete newbie to the world of blogging, and thus choosing the right theme for my blog has become great problem for me.
    And the bugging question is that does this “Genesis framework theme” have two sidebars because I value a theme with two sidebars so much.
    Thanks.

  26. Nathan

    I have couple questions regarding this pls.

    Basically I have 0 coding skills and i am using visual editing software to edit a theme i bought. my edits are basically changing the logos, deleting extra pages and changing widgets/sliders on the pages from the themes own selection

    1) Do you think I should have a child theme aswell as this theme gets updated once a week and its a new theme, meaning there will probably be a lot more updates in the future. ?

    2) if not, what do you think is my best approach to updating this?

    I am a newbie to WP, just used it this week for the first time lol

    • Faizan

      Please, reply to this answer, as I want to know the same things.

      • WPBeginner Support

        Hi,

        You can update parent theme, it doesn’t affect child theme. The whole purpose of child themes is to allow you to update your themes without losing your customization.

        管理者

  27. Aad

    I still have a question after reading your great post.

    I’m using a theme and haven’t changed anything major and especially not in style.css or functions.php.
    I have only changed some auto ‘translation’ flaws the theme has such as php files found in the ‘inc’ map. For example file: /inc/shortcodes/portfolio.php

    My question is now:
    Are these text adjustments that i made in the php codes going to be deleted once i update theme? And should i therefore use a child theme?

    Hope to receive you advice shortly.

    P.s.: I’m a great fan of your posts. Thanks!

    • WPBeginner Support

      Hi Aad,

      Yes most likely they will be replaced. You need to backup your theme before update. After the update you can copy paste your changes from backup to the newly updated theme.

      管理者

  28. molly

    Would you recommend using a child theme for someone with zero coding skills?

    • WPBeginner Support

      Actually it depends on what they want to achieve. The most important reason for using a child theme is when you want to customize your theme without editing the parent theme.

      管理者

  29. Mark Toon

    My computer knowledge is all host based, 3rd generation stuff, so all this web “stuff” is a foreign language – one I don’t really want to learn. Yes, I’m that old! I understand parent child relationships in databases, but this web stuff is beyond me.

    My kids gave me a website as a christmas present to display works from my hobby. Nice! Initially, my daughter set the site up using a stock theme, and put some content out there, just to show me what was possible. The thought was that a stock, off the shelf kind of set-up would be enough for me to post pictures and text, in some kind of organized fashion. That’s really all I’m doing. No e-commerce, very little email, and not a whole lot of commenting and replying. (That’s what Facebook is for…)

    A week after Christmas, after I had set the site up the way I wanted it, I updated the theme and lost everything! Since then, I have avoided anything that looks like a theme update.

    Now, hearing about how many security issues there are (and after having one particular page targeted by some kind of Russian spammers leaving endless and pointless comments) I see that may not be the best approach.

    Is there any way to update a parent theme *without* losing everything? I’ve got a years worth of work created online and really don’t think I want to have to restart from scratch because of a random update.

    Am I as screwed as I feel I am?

    • WPBeginner Support

      Hi Mark :)

      It is alright to feel overwhelmed by complex terminologies. However, many of our users, who all started like that eventually got better at managing their websites like total pros :)

      Yes you should keep your theme updated. All good quality WordPress themes can be easily updated. Unless you make direct changes into your theme files. Those changes will be overwritten when you update the theme.

      Bookmark our WordPress troubleshooting guide and you will be all set to fix minor issues on your own without needing any help. It also have a section on how to switch to a default theme, which is the first step in fixing a poor theme update.

      管理者

      • Stephanie

        What would constitute a “direct change to a theme file” ? Are we talking font changes? Images? Apologies, I am a beginner and some assumptions go over my head.

        • WPBeginner Support

          We mean going into the theme’s files and editing the code there such as under Appearance>Editor

  30. Bryan

    Hi,
    its very helpful in my blogging. i use Parent and child both of them.
    please check my link.

  31. Eddie

    Hi There, Great article! This really clarifies a few things for me, but now brings me to question some of my motives.

    I’m interested in setting up a directory theme on a sub-domain HOWEVER as it appears most of these theme are child themes BUT I don’t necessarily have a need for a full fledged parent theme. My question is, do I / should I install a parent framework theme 1st in order to take full advantage of the directory child theme?

    Hope that makes sense?
    thanks
    Ed

    • WPBeginner Support

      Yes, you can check documentation for your directory theme to see how they recommend setting up a child theme.

      管理者

  32. Mato

    I recently used hueman theme and I was able to create my own child theme for the today theme. Just added the template tag in style.css for the child theme to reflect the parent theme and a code to import stylesheets in the functions.php of the child theme. From there, I could make all the modifications I wanted to the parent theme. Was a good experience learning how to create a child theme. Thanks to wpbeginner for being there for us.

  33. Richard Jones

    Please can you explain how duplicating a template file into a child theme and then making a minor modification to it allows one to benefit from a security update to the parent theme? Surely the the child themes’ code will retain the vulnerability and continue to override the parent theme’s fix?

    • WPBeginner Support

      Most well coded WordPress themes avoid coding functionality right into a template. Instead, these functionalities are stored in different directories like inc, js, or functions.php file. Most templates used to display pages or sections on your website, usually generate HTML from template tags defined elsewhere in the WordPress core or your theme’s functionality files. It is not recommended to duplicate functionality files, this would result into error because those functions would already be defined in the parent theme.

      Still, if you are unsure, then you can manually update your child theme after an update to the parent theme. You can use file difference tools to see whats changed into new template files and then copy those changes into your child theme.

      管理者

  34. bikeman

    Please can you explain how duplicating a template file into a child theme and then making a minor modification to it allows one to benefit from a security update to the parent theme? Surely the the child themes’ code will retain the vulnerability and continue to override the parent theme’s fix?

  35. Daquan Wright

    I need to ask a question answer asap as I am working on my own site.

    Do I need to create a child-theme for my own wordpress theme (as I am the only one who will update it)?

    I’ve never used one before.

    Also, do I need to create a child-theme for clients when they will be able to modify their theme (but no updates will be released for it)?

    I will be making websites, but I’m not releasing periodic updates. So I need these points clarified, or, should all wordpress themes use a child-theme?

    • WPBeginner Support

      Its up to your personal choice. If you are writing a theme for your own use, then you can make changes to it directly.

      About adding child theme for clients, again it is up to you.

      管理者

  36. Joshua Grant

    Something to watch for: child themes aren’t ALWAYS totally update safe. We recently hit an issue with a client site where a parent theme — one of those “premium all-in-one” themes that shall remain unnamed — significantly changed their page structures and classes, invalidating all of our child theme CSS.

    • david b

      hi gurus. ok i have a website that i have spent eternity on getting it exactly how i want it. i paid money for a theme i liked it so much. now just when everything was going great, i am no longer able to update it (because it totally ruins my site in every way imaginable) and it is no longer responsive as it once was. The weird thing is, it is responsive on an android tablet just not apple stuff. Does anyone have any advice to get it responsive again? Should I somehow start over and use a child theme? (I never used a child theme I made all of my myriad of customizations on the parent theme)…what are my options? Any help would be GREATLY appreciated!

  37. Mish

    Hi…
    I am using Twenty Eleven Theme and the only change that i wanna do, at the moment, is add posted on date to it. Can you tell me how to do that?

  38. Phil Long

    Child themes: potential complications outweigh the marginal benefits. You may as well just install an original version which you never touch and a customer version. So you always have the originally too reference/fall back on.
    Problem with child themes: Do you have the same differentiation built in between Splash and Site Home Page?
    1, If I wanted to customise the CSS, why not just create a custom_style.css and enqueue it after style.css.
    2. But the main problem I have is that it preservers the parents functions file. Considering its the hub of the site you should as a developer be getting to know that file really well, not be presented with a blank child functions.php. And worst than, that the Parent functions.php usually sets up a whole load of constants & includes pointing to files and sub_directories in the parent theme

    2(a)Throughout your theme’s child php files their are more than likely CONSTANTS pointing the parent parent php files. If the whole purpose is to only customise the child theme then all those constant (or at least they declarations will have to be re-pointed).

    2(b)With the includes also pointing at parent files at best it could leave you mighty confused about why your child edits don’t see to be effecting anything. At worst it could create a fatal repeated function declaration error. So you’ll need to cut the includes out of the parent functions and replace them with the includes in your child.php but point them at child paths and files.php they will could cause.

    2(c)And then then are all the other parent functions in your functions.php which refer to parent.php files/functions. Again this means if you want to change any child.php you have to trawl through hierarchies of function calls to see if its triggered by the parents functions.php. If it is, then in order to maintain the principal of not customising parent.php you have to move that function from parent function.php to the child’s.

    I just think its not work the hassle, and certainly if I was to use a child again I would CUT AND PASTE all the entirety of parent functions. php into the child.

    3. AND when the parent theme UPGRADES you lose the fallback of the parent theme anyway.. although this might be preferable to the upgrade wiping out all your customised child.php files as happened to me once.

  39. Wayne Hatter

    I seriously think that this post is going to confuse a lot of people. Because as a developer… this is totally not targeted to me. Because I don’t even use a framework and my workflow streams pretty good.

    With the frameworks, you still have to learn the hooks and what they do.

    The same amount of time it would take to learn those hooks a person could learn to use the core WordPress hooks all the same.

    So here is a thought. It frameworks are the way to go, why are there still a great amount of themes being developed?

  40. jay

    Hi,

    I am a beginner and I am making a blog on weight loss. Do I need to get Genesis before selecting any template?

    I was just going to buy a theme from themeforest and someone stopped me and told me to buy a parent theme first? Is it needed for newbies? Or can we start with a theme from themeforest?

    I look forward to your response.

    Thanks

    • WPBeginner Support

      No it is not needed. Genesis is not a parent theme it is a theme framework. You don’t need either of them you can just purchase any good quality theme.

      管理者

    • Bales

      Pls do some research before moving forward. I am a beginner too been learning as much as possible before picking a theme, reason being that I don’t want to put all this hard work into a website business and have it perform bad or worse totally fail because I jumped the gun and didn’t do my homework. Tip – themes that are badly coded can hurt your SEO and cause other issues.

      Now if you just want to play around with WP and build a website, not sure if you will be doing this long term, I would start with the themes already on WP.

      I have heard good and bad things about themes sold on Themforest. I would Google …are themes purchased on Themeforest reliable ….and see what you find. As WPB support said no need to use Geneisis just use a good quality theme. True but as a newbie, I assume you are not a devoloper, knowing what a “Good quality theme” looks like, is not easytask. Like I said pls reach if you are serious about having an online website biz.

      Now I have found my new passion after all my research, love making my own website for my business and will continue to design sites for others in my niche after all I have learned. I teamed up with Geneisis because I feel like I have the best of both worlds. They worry about WP updates and best practices and best cleanest code to use and a ton more thing I don’t care to learn about….. And I do the designing and tweaking and build my website with confidence knowing I did my research and picked the best company to help me with my goals, once again I went this route because I not a devoloper nor do I want to be one.

      Yes devoloper can make their own themes as some have commented this topic of child themes etc this is not for them. But I love it and happy I too can create child themes and not have to go back to school, to build a solid website for my biz. I just want to learn enough CSS etc to tweak themes built on Geneisis framework and I am ready to go. JUST my 2 Cents ….LOL

  41. imran hussain

    Very helpful for understanding child theme. thanks.

    imran

  42. Ria

    Hi, I wanted to ask if it’s true that child theme could be not so useful but wrong thing for website? I have wordpress twenty fifteen theme (customized). once I download already made child theme, was making some changes (copy/paste information from main files to shild theme) and “broke” my site. The guy who helped me to customize the theme, when I asked to create child theme, told me, that child themes makes site work slower, can make you confused (if you are making many changes, which one file is already changed) and it’s not good for site.Like all changes should be made only in main files. And he refused to create child theme. So how it is? Because everywhere I read that child theme is “must”. Is my “helper” answer is only laziness to make more work? So how it is?:) Thank you for help:)

    • WPBeginner Support

      Child Themes are a time saver. Some WordPress developers may not like to create child themes and would rather edit the main theme files. This is not safe in the long run and we will advise you against it. Perhaps you should consider getting better adviser for your project.

      管理者

    • Steve Wilkinson

      That’s a really good ‘business’ plan for a developer who wants to keep you locked into their service. Every time that theme updates, they will have to rebuild their version of it. Or worse, you’ll not get the theme updates and miss improvement, but maybe even be open to exploits.

      Web development IS NOT a one-time thing! Unfortunately, that’s the way a lot of web design shops are setup. And usually, I’ve often found these are the marketing and graphic arts oriented ones that maybe understand the marketing/visual aspects of a site really well, but they don’t know much of anything about the technical side.

      I about fell out of my seat a few months back, when on a major podcast for graphic design professionals, the whole crew started talking about WordPress, plugin, and theme updates… and advised people not update stuff because that often breaks things!

      Well, yea… that’s why you don’t do what these folks are doing. They build a pretty site and hand it off to the client… who has to deal with hosting and issues around updating, not updating, etc. Rule #1 of WordPress sites is KEEP STUFF UP TO DATE!!! If whatever system/developer you’ve picked can’t handle that… you’ve picked the wrong one.

  43. Kirsten

    I am completely new to child themes. Could somebody give me a for instance on what is “an extreme change”, which means that a child theme would be the way to go for me?

    Thanks :-)

  44. Mike

    I am learning child theme it is crazy, Its so much I was never good with coding

  45. Maryam

    Let’s suppose I need to modify the header.php file so i over-ride it and place it in my child theme folder – along comes a theme update and the header.php file in the parent is updated with some useful updates. Will they apply to my child theme?

    • Steve Wilkinson

      I need to look into this more in detail (as I’m not an in-depth theme coder), but my understanding is that it’s a maybe/no kind of situation. Unless I’m mistaken, I think you can think of a child theme as kind of an overlay situation (remember those classroom projectors with sheets vellum and how they could be layered?).

      So, I suppose you’d get some of the new code and functions in the parent, so long as the child wasn’t overriding them. And, if you’ve copied the entire file from the parent, the child is going to have everything except the changes you made and the new updates they’ve made.

      But, if they’ve changed something where your child-them also has it declared, I think the child will override. I’d *love* to hear more about this, as it’s something I’ve been looking into more recently as well in customizing WooCommerce stuff (i.e.: what do I need to look for each time WooCommerce updates the template files).

      I’m sure a good theme developer could answer this much better, but that’s kind of my layman’s description as a code tweaker. :)

      • Anne Marie

        Thank you so much for the transparency/overlay comparison. My understanding of it all fell into place when I read that. Thanks again!

  46. WPBeginner Staff

    Thomas,

    A proper Theme System was introduced in WordPress 1.5 back in 2005. The earliest mention of child theme we could find was in the 2006 codex article on theme development. Hope this helps.

    • Thomas Vasquez

      Thank you, yes it does. You wouldn’t by any chance happen to have a link to that article do you, I could really use it. Thank you again.

    • Thomas Vasquez

      That is great, Thank you very much. Any chance you might have a link for that reference

  47. Thomas Vasquez

    Maybe someone here can provide an answer to a question I have been looking for for a while now: When did WordPress first introduce child themes?

    I have searched the Codex and checked each version and cannot find any mention of when they were introduced (or maybe I missed it?)

    Does anyone know?

  48. Dzagro

    it is helpful, well cleared now, thanks ;)

  49. HannahHudson

    This was very clear and direct. Thanks for the writeup.

  50. Kendall

    I am thinking of switching my blog from a free wordpress theme to Genesis Framework + Theme. Do you have any articles about picking the right theme? Also how to create custom headers/ logos for your blog that you can easily add to your site through the Genesis Framework?

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。