Forum Replies Created
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
tmg12Member
Looking at the genesis_skip_links_output filter to see if I can change the markup that way.
$links = apply_filters( 'genesis_skip_links_output', $links ); // write HTML, skiplinks in a list with a heading $skiplinks = '<section>'; $skiplinks .= '<p class="screen-reader-text">'. __( 'Skip links', 'genesis' ) .'</p>'; $skiplinks .= '<ul class="genesis-skip-link">'; // Add markup for each skiplink foreach ($links as $key => $value) { $skiplinks .= '<li><a href="' . esc_url( '#' . $key ) . '"> ' . $value . '</a></li>'; } $skiplinks .= '</ul>'; $skiplinks .= '</section>' . "\n"; echo $skiplinks;
This code is from the header.php, I changed the markup to go from h2 to p. It works but had some unwanted formatting issues on other elements of the page.
So, i tried this, hook the filter into the header;
add_action ('genesis_header','skip_links_head'); function skip_links_head() { $links = apply_filters( 'genesis_skip_links_output', $links ); // write HTML, skiplinks in a list with a heading $skiplinks = '<section>'; $skiplinks .= '<p class="screen-reader-text">'. __( 'Skip links', 'genesis' ) .'</p>'; $skiplinks .= '<ul class="genesis-skip-link">'; // Add markup for each skiplink foreach ($links as $key => $value) { $skiplinks .= '<li><a href="' . esc_url( '#' . $key ) . '"> ' . $value . '</a></li>'; } $skiplinks .= '</ul>'; $skiplinks .= '</section>' . "\n"; echo $skiplinks; }
This added new screen reader markup, but didn't modify the existing markup.
Anyone got any ideas?
Thanks,
Tom
tmg12MemberFound the solution.
Just needed to hook in before the loop for it work.
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)