Changeset 1770956
- Timestamp:
- 11/19/2017 08:18:04 PM (8 years ago)
- File:
-
- 1 edited
-
css-page-ancestors/trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
css-page-ancestors/trunk/readme.txt
r1770896 r1770956 24 24 So, let's imagine you have this tree of pages on your site: 25 25 26 Home27 Clients28 -Web29 --EShops30 --Portfolio31 -Print32 Contact26 * Home 27 * Clients 28 * Web 29 * EShops 30 * Portfolio 31 * Print 32 * Contact 33 33 34 And you want all the Web pages to have a black background, or/and all the Portfolio pages to have a red background, you just add to your css .achestor-web {background:black;} or/and .achestor-portfolio {background:red} and you are ready.34 Let's see this scenario: You want all the pages under 'Clients' to have a red background. Now, it's easy to do that - but only for the 'Web', and 'Print' pages because Wordpress gives you only the fathers in the body classes - in this case, the id of 'Clients'. 'Eshops' and 'Portfolio' can also have a red background, but you will have to add a new class in your css with the id of 'Web' at your css. And, if you add pages under 'Eshops', same thing, you will have to add a new class in your css file with the id of 'Eshops' page. And, all this is easy if you do it yurself - but if you handle the site to an editor, that knows only to create content - you will have to add the class in the CSS every time someone adds a level to all this. 35 35 36 The order is with top ancestor first (in our example, Portfolio page will have "ancestor-clients ancestor-web") - this way, it's simpler in CSS to overwrite the -clients class with the -web attributes. 36 Whith this plugin all the ancestors will be in your body as class names - as a slug, and as an id. And you want all the pages under 'Clients' to have a red background you just add to your css .achestor-clients {background:red;} in your css, and you are done - no matter the level the final page is under. 37 38 Also, the order is with top ancestor first (in our example, Portfolio page will have "ancestor-clients ancestor-web") - this way, it's simpler in CSS to overwrite the -clients class with the -web attributes. 37 39 38 40 There is no writing on the database, or other change on the site, so, even if something goes wrong, just de-activate the plugin, and you'll be fine.
Note: See TracChangeset
for help on using the changeset viewer.