Community Forums › Forums › Archived Forums › General Discussion › how to add class to main class="content" and aside="sidebar"
- This topic has 7 replies, 2 voices, and was last updated 10 years, 5 months ago by fox.
-
AuthorPosts
-
November 3, 2013 at 8:05 pm #70746foxMember
I want to add a class to the Main class="content" section that looks like this:
<main class="content" role="main" itemprop="mainContentOfPage" itemscope="itemscope" itemtype="http://schema.org/Blog">and to the Aside class="sidebar" section that looks like this:
<aside class="sidebar sidebar-primary widget-area" role="complementary" itemscope="itemscope" itemtype="http://schema.org/WPSideBar">There's a filter to add a body class. I did a quick look through the Genesis files and couldn't find where these filters were and how to add the class to them. Does anyone here know how to add a class to these areas?
Thanks.
November 6, 2013 at 9:30 am #71254nutsandboltsMemberCan you post a link to your site? It's always easier for us to help if we can see what's going on.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 11, 2013 at 9:21 am #72312foxMemberAndrea,
This isn't on a live site. The site shouldn't matter. This is the core code for Genesis. There's a filter to add a class to the <body> tag. I'd like to add a class to the <main> tag too.November 11, 2013 at 9:25 am #72313nutsandboltsMemberMy apologies - many people who post asking for help are beginners, so I was asking for a link to make sure you were using an HTML5-compatible theme before anyone spent time looking for a solution. You wouldn't believe how often we provide long, detailed responses only to find out that the site in question isn't able to utilize that solution.
I'll do some research and see if I can find something useful for you.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 11, 2013 at 9:55 am #72315nutsandboltsMemberOn a test site with an HTML5 Genesis child theme enabled, the classes you listed are assigned automatically (which is what I was thinking when I originally replied to this topic). It would be helpful to know more about your project, i.e. what child theme you're using, since this isn't something you should have to do manually with Genesis 2.0.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 11, 2013 at 11:15 am #72321foxMemberAs you wrote:
the classes you listed are assigned automatically (which is what I was thinking when I originally replied to this topic)
Both the <main> and <aside class="sidebar"> are assigned automatically. There are filters to add classes to the <body> class (http://my.studiopress.com/snippets/custom-body-class/) and we can add/remove the entry meta html5 markup (http://my.studiopress.com/snippets/entry-header/#remove-markup) and the entry footer markup (http://my.studiopress.com/snippets/entry-footer/#remove-markup). But there's nothing listed on the site to add/remove the <main> and <aside>.
If I could remove it then I could add back in my own options and classes like I can on the entry header and footer. But I haven't been able to find the code in the Genesis files to edit it. (I'm not a beginner and I'm not an expert coder either.)
Let's say I'm using Focus Pro, as the child theme (which I've been playing with for this. Yet it's a custom theme.). The answer wouldn't lie in the child theme.
November 11, 2013 at 11:20 am #72322nutsandboltsMemberNo, the answer doesn't lie in the child theme. But for those of us who are trying to help you, understanding what you're trying to accomplish is essential. We have no way to know what level of knowledge/understanding you have or what your goal is unless you tell us.
You'll find that it's much easier to get the help you need when you are patient with the (unpaid) volunteers who take time to provide forum support - if we ask a question, there's generally a reason why.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 11, 2013 at 11:31 am #72327foxMemberI appreciate your help and hope it didn't come across the wrong way.
I merely want to add a class to those so I can add custom css that wouldn't apply at the Body level or at the Entry level but in between those and also to the <aside>.
I have a feeling I'm going to be adding a body classes on these and duplicate some css. -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.