Changeset 1770979
- Timestamp:
- 11/19/2017 08:52:29 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
r1770972 r1770979 34 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. So, all this is easy if you do it yourself - 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 W hith this plugin **all the ancestors of a page, no matter the depth** 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.36 With this plugin **all the ancestors of a page, no matter the depth** 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 37 38 38 Finaly, 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.
Note: See TracChangeset
for help on using the changeset viewer.