• This is the kind of stuff that strikes me as entirely pointless. A search of style.css finds no such class as “content-area”. In fact just to be sure there were no type-o’s I did a Copy & Paste into the Find box and it finds nothing, No Such Thing.

    Just to be sure we’re all on the same page here I’m looking at page.php in the twentyfifteen theme folder the index.php and the style.css files. The opening div right after get_header() is like so…

    <div id="primary" class="content-area">

    Neither “primary’ or Content-area actually exist in style.css
    And I don’t guess it really matters except that no such class actually exist and if it does I be really curious to know where WordPress is keeping all these secret classes.

    I suppose in the end I can just write my own as needed. I just don’t understand why they did it.

    Is there any kind of explanation for this? Why does the default Index.php page call for a class that doesn’t actually exist?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter ronc0011

    (@ronc0011)

    OOPs sorry.. not the default index.php page but rather the default page.php page in the twentyfifteen theme folder

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Hi ron0011, Are you using a browser developer tool like Firebug or the one built into Chrome? You can search CSS files a lot easier that way.

    Why does the default Index.php page call for a class that doesn’t actually exist?

    Because it may (or may not) be used in a child theme that is based on that theme.

    It really is as simple as that. ?? Adding in classes lets people that use your theme in some other way than you imagined have the ability to target elements that you haven’t needed to, giving them a lot more flexibility in the diesign of their site.

    Thread Starter ronc0011

    (@ronc0011)

    Catacaustic,

    So you’re saying that it actually is just a suggestion for a class you may or may not want to create to style said element.

    Well, Cool I guess.

    Would have been even cooler to have had some comments or something to indicate such. That might saved dummies like me from wasting an hour looking for something that doesn’t actually exist.

    And thanks to everyone for the replies.

    Having comments for every class name would result in huge HTML bloat. Would you want an extra 100 or more lines per page slowing down your page, adding to your data transfer and making the page larger, just as to see some notes for future developers? Sometimes classes are added as notes, and so you can get more idea of what that <div> element is actually meant to do or contain. I think this is one of those cases. Having a class of content-area pretty much maps out that it’s an area that holds content. That should be all the notes that you’d need.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘No such thing’ is closed to new replies.