This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionBoth sides next revision | ||
devel:wp_to_dw_template [2015-06-25 22:52] geekitude [Header] minor internal link correction | devel:wp_to_dw_template [2015-09-26 19:41] Aleksandr | ||
---|---|---|---|
Line 4: | Line 4: | ||
- | ===== 1. Start with starter | + | ===== 1. Start with Starter |
- | Follow the first 3 steps on the general template tutorial: [[devel: | + | Follow the first 3 steps on the general template tutorial: [[devel: |
Commit already to be able to see differences later. | Commit already to be able to see differences later. | ||
- | |||
Line 16: | Line 15: | ||
* Read about the [[:main window]] to understand words and functionality used in the following. | * Read about the [[:main window]] to understand words and functionality used in the following. | ||
* Refer to [[devel: | * Refer to [[devel: | ||
- | * Refer to [[#WP vs DW functions]] for knowing which WP function can be substituted with which DW function. | + | * Refer to [[#WP vs. DW functions]] for knowing which WP function can be substituted with which DW function. |
==== Meta elements ==== | ==== Meta elements ==== | ||
Line 22: | Line 21: | ||
Copy any relevant meta elements (anything between '' | Copy any relevant meta elements (anything between '' | ||
- | Check if the WP theme adds anything to the body classes via '' | + | Check if the WP theme adds anything to the body classes via '' |
==== Site containers ==== | ==== Site containers ==== | ||
Line 61: | Line 60: | ||
Because the functionality is different from WP's usual sidebar, most " | Because the functionality is different from WP's usual sidebar, most " | ||
- | ==== WP vs DW functions ==== | + | ==== WP vs. DW functions ==== |
Most of the above will require you to change WP-specific functions to DW-specific functions. These are usually within '' | Most of the above will require you to change WP-specific functions to DW-specific functions. These are usually within '' | ||
Line 110: | Line 109: | ||
Copy WP's '' | Copy WP's '' | ||
- | | + | <code ini> |
+ | css/ | ||
+ | </ | ||
If '' | If '' | ||
- | | + | <code ini> |
+ | css/ | ||
+ | </ | ||
Or you can extract the %%@media%% queries into separate CSS files and add them to the '' | Or you can extract the %%@media%% queries into separate CSS files and add them to the '' | ||
Line 150: | Line 153: | ||
Move the print section from the original '' | Move the print section from the original '' | ||
- | | + | <code ini> |
+ | css/ | ||
+ | </ | ||
==== Necessary changes ==== | ==== Necessary changes ==== | ||
Adjust all paths (to images, fonts, etc) to be relative to the template' | Adjust all paths (to images, fonts, etc) to be relative to the template' | ||
- | |||
Line 178: | Line 182: | ||
You have more freedom with the image detail page. You can either move your whole layout into that file (including header and sidebar, etc) or create a different, minimal layout. | You have more freedom with the image detail page. You can either move your whole layout into that file (including header and sidebar, etc) or create a different, minimal layout. | ||
- | |||
==== Special DW elements ==== | ==== Special DW elements ==== | ||
Line 193: | Line 196: | ||
Concentrate first on the modes most users are likely to see most, i.e. edit, search, login,... Something like the admin section on the other hand doesn' | Concentrate first on the modes most users are likely to see most, i.e. edit, search, login,... Something like the admin section on the other hand doesn' | ||
- | |||
Line 211: | Line 213: | ||
If you have this in your '' | If you have this in your '' | ||
- | | + | <code ini> |
+ | __theme_color__ = "# | ||
+ | </ | ||
You need to substitute each ''# | You need to substitute each ''# | ||
Line 220: | Line 225: | ||
You can have other values than colours as a style.ini placeholder. Anything you'd like to be configurable which has to do with CSS can be driven by this. E.g. set the template width or responsive breakpoints or fonts or font sizes or a background image or drive various sub themes with a variable... | You can have other values than colours as a style.ini placeholder. Anything you'd like to be configurable which has to do with CSS can be driven by this. E.g. set the template width or responsive breakpoints or fonts or font sizes or a background image or drive various sub themes with a variable... | ||
- | ==== WP vs DW classes ==== | + | ==== WP vs. DW classes ==== |
There are certain functionalities which both DW and WP have but which are expressed in different class names. | There are certain functionalities which both DW and WP have but which are expressed in different class names. | ||
- | ^What ^WordPress ^DokuWiki^ | + | ^ What ^ WordPress |
- | |hide something accessibly |screen-reader-text |a11y| | + | |hide something accessibly |
- | |clearing floats |clear |group| | + | |clearing floats |
- | |align media left |alignleft |medialeft| | + | |align media left |
- | |align media right |alignright |mediaright| | + | |align media right |alignright |
- | |align media centred |aligncenter |mediacenter| | + | |align media centred |
- | |menu item with children |li.menu-item-has-children |li.node| | + | |menu item with children |
- | |selected menu item |li.current_page_item%%|%%current-menu-item|li .curid| | + | |selected menu item |
- | |parent(s) of selected menu item|li.current_page_ancestor \\ + li.current_page_parent|(// | + | |parent(s) of selected menu item |li.current_page_ancestor \\ + li.current_page_parent |
Line 244: | Line 249: | ||
When you cannot change the class DW gives you (media alignment and menu classes), let the class from DW inherit the one from WP. This is possible with the power of [[devel: | When you cannot change the class DW gives you (media alignment and menu classes), let the class from DW inherit the one from WP. This is possible with the power of [[devel: | ||
- | < | + | < |
.class-from-dw { | .class-from-dw { | ||
.class-from-wp; | .class-from-wp; | ||
Line 254: | Line 259: | ||
When you don't need to use the DW classes ('' | When you don't need to use the DW classes ('' | ||
- | < | + | < |
.class-from-wp { | .class-from-wp { | ||
.class-from-dw; | .class-from-dw; | ||
Line 264: | Line 269: | ||
You can also just search for all WP classes and replace them with the DW classes in both HTML/PHP and CSS/LESS. | You can also just search for all WP classes and replace them with the DW classes in both HTML/PHP and CSS/LESS. | ||
That might also not work 100% as you might need to fix other selectors (especially in menus). But the amount of possibly necessary fixes will be the same in both ways. | That might also not work 100% as you might need to fix other selectors (especially in menus). But the amount of possibly necessary fixes will be the same in both ways. | ||
- | |||
Line 270: | Line 274: | ||
To avoid [[devel: | To avoid [[devel: | ||
- | |||
Line 292: | Line 295: | ||
FIXME Add more... | FIXME Add more... | ||
- | |||
Line 304: | Line 306: | ||
* [[devel: | * [[devel: | ||
* [[devel: | * [[devel: | ||
+ |