Child themes

On child themes :

In MailPress 5.2,
in mp-content/themes there are now 6 folders :

  • _template:
    • contains a “minimalist” mailpress theme
    • this mp theme is the parent theme of following child themes :
      • MailPress
      • nogent94
      • twentyten
    • all mp theme folders starting with ‘_’ will be hidden on all admin page lists or screens.
  • MailPress : child theme of _template mp theme (see tag ‘Template’ in MailPress/style.css header).
  • nogent94 : child theme of _template mp theme (see tag ‘Template’ in nogent94/style.css header).
  • nohtml : theme for plaintext only mails.
  • twentyten : child theme of _template mp theme (see tag ‘Template’ in twentyten/style.css header).
  • plaintext : hidden default theme for plaintext part of mails. To customize this part of the mail you can copy the plaintext folder IN your mp theme folder (my_mp_theme_folder/plaintext) and adapt it to your needs.

On specific files in your parent/child mp themes :

  • functions.php : are required in the child theme in following order : parent, child.
  • All template files with tag ‘Template Name’ : if required, searched in following order : child, parent and required once.
  • default.php : if no template file required or found (see above), searched in following order : child, parent and required once.
  • style.css : if required ($this->get_stylesheet();), searched and integrated in the mail in following order : parent, child.
  • style.php : style.php classes will be applied in following order : parent, child.
  • special rule for plaintext part : if the searched file is not found in child, parent optional plaintext subfolder, it will be searched in plaintext folder.

On ‘child themes’ api :

  • $this->get_template_part(name) : name.php searched in following order : child, parent and required once.
  • $this->get_header() : equivalent to $this->get_template_part('header');
  • $this->get_footer() : equivalent to $this->get_template_part('footer');
  • $this->get_stylesheet() : style.css are integrated in the child theme in following order : parent, child.
  • special rule for plaintext part : if the searched file is not found in child, parent optional plaintext subfolder, it will be searched in plaintext folder.

Old mailpress themes should not be impacted, however some tests are always welcomed.
Thank you for your help !

This entry was posted in News. Bookmark the permalink.

2 Responses to Child themes

  1. ovidiu says:

    do I have to leave a customized child theme in there with the danger of overwriting it with an update or does Mailpress meanwhile support moving child themes outside of the mailpress folder?

  2. admin says:

    There are several ways to get what you want. Here are several answers :

    a) http://groups.google.com/group/mailpress/browse_thread/thread/b312941bd578f4dd/f29dbc53f659bca8?lnk=gst&q=MailPress_theme_root#f29dbc53f659bca8

    b) I can’t find the thread where someone said he included the ‘MailPress_theme_root’ hook in each of functions.php of his WP themes returning the path to a subfolder of his WP theme (subfolder containing the mailpress theme).

    c) see explanations in mailpress/mailpress-config-sample.php

    And I encourage everyone to follow the upgrade guidelines documented in the readme.txt instead of using wordpress automatic upgrade !

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>