Changeset 1770972
- Timestamp:
- 11/19/2017 08:46:38 PM (8 years ago)
- File:
-
- 1 edited
-
css-page-ancestors/trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
css-page-ancestors/trunk/readme.txt
r1770956 r1770972 12 12 13 13 == Description == 14 Please, keep in mind that THIS IS IN BETA. 14 *Please, keep in mind that THIS IS IN BETA. I'm relying to your feedback, positive or with suggestions, to release it out of beta* 15 15 16 16 This plugin will give you the extra class you need in your <body> tag of ALL (and not just one) of the anchestors of a page in Wordpress. … … 32 32 * Contact 33 33 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.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 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.36 Whith 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 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.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. 39 39 40 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.