Home › Community Forums › Epik Theme Support › where to add id="content" for skip links
- This topic has 8 replies, 2 voices, and was last updated 9 years ago by
Wes.
-
AuthorPosts
-
January 15, 2014 at 11:26 am #10034
scottpruett
CustomerWes โ I’m adding a couple accessibility features to a site, and need to place an id=”content” somewhere around the page title so users who navigate with keyboards/etc can jump past the menu. What’s the easiest way to do this?
Thanks,
ScottJanuary 15, 2014 at 8:36 pm #10051Wes
ModeratorI’ve actually never dealt with accessibility features before (so I’m probably the wrong person to ask). But if all you need is to add an ID, maybe you could do it the same way I did when I added the
.head-wrap
in the functions file. Give that a try and see if that works.January 16, 2014 at 2:22 pm #10063scottpruett
CustomerThanks Wes. Skip links for accessibility aren’t anything special. It’s just a “skip to content” link before everything else (which is hidden unless it receives keyboard focus), which then allows a user to skip over nav menus. Keyboard navigation is done by hitting Tab to move from link to link. Tabbing through menus can get cumbersome.
Anyway…
What you did in functions.php w/ the
.head-wrap
stuff works by adding the id to the div, but I need to figure out how to do that with the post/page title instead of the site header. I don’t see what snippet even references the page title: http://my.studiopress.com/snippets/ โ Any ideas?I like Genesis, but it sure makes some things more complicated than necessary.
January 16, 2014 at 8:34 pm #10068Wes
ModeratorTake a look at the first code snippet here – http://my.studiopress.com/snippets/header/ …I’m not sure if that works with 2.0 or not, but if it does then you should be able to add your code inside the html part.
January 16, 2014 at 9:21 pm #10070scottpruett
CustomerThanks Wes, though I need an id on the page title, not the site title.
I know this should be directed to the SP team, but since we’re here… what about these? http://my.studiopress.com/snippets/entry-header/
I just need to change…
<h1 class="entry-title">Page Title</h1>
to…
<h1 class="entry-title" id="content">Page Title</h1>
January 17, 2014 at 1:13 pm #10076Wes
ModeratorWhoops, I thought you were talking about the site title this whole time ๐
I did a ton of searches, and the only thing I can see is how to add or remove page titles…..but I haven’t seen anything that explains how to edit the page title in the way you need. I’m pretty sure this can be done, but I have no idea how. You’ll probably want to head over to the SP forum to see if one of the devs may know how to do this. If I come across anything I’ll post it here.
January 17, 2014 at 1:55 pm #10080scottpruett
CustomerNo problem. My bad if I could’ve been more clear.
I’ll ask the SP crew about this, as your findings are pretty much in line with mine.
See what I mean about Genesis making this more complicated than it needs to be? Haha.
Thanks Wes!
Scott
January 19, 2014 at 4:16 pm #10089scottpruett
CustomerHere’s the solution…
add_filter( 'genesis_post_title_output', 'ac_post_title_output', 15 ); function ac_post_title_output( $title ) { if ( is_singular() ) $title = sprintf( '<h1 class="entry-title" id="content">%s</h1>', apply_filters( 'genesis_post_title_text', get_the_title() ) ); return $title; }
January 19, 2014 at 8:41 pm #10090Wes
ModeratorGreat! I’ll reference this post if someone else needs it. Thanks for getting back with me.
-
AuthorPosts
- You must be logged in to reply to this topic.