Plugin Directory

Changeset 1770956


Ignore:
Timestamp:
11/19/2017 08:18:04 PM (8 years ago)
Author:
giannisg
Message:

Updated readme.txt file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • css-page-ancestors/trunk/readme.txt

    r1770896 r1770956  
    2424So, let's imagine you have this tree of pages on your site:
    2525
    26 Home
    27 Clients
    28  -Web
    29    --EShops
    30    --Portfolio
    31  - Print
    32 Contact
     26* Home
     27* Clients
     28    * Web
     29        * EShops
     30        * Portfolio
     31    * Print
     32* Contact
    3333
    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.
     34Let'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.
    3535
    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.
     36Whith 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
     38Also, 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.
    3739
    3840There 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.