Assigning ID to Main Content for Accessibility

I’m using WP Accessibility to add skip links for accessibility and need to assign an ID to the main content container. I found this older post (https://theme.co/apex/forum/t/enabling-skiplinks-accessibility/15364/4) and tried the solution given there but it doesn’t work for me. Possibly because I’m using Pro and not X?

In any case, what adjustment can I make to the code below to assign an ID to the main content for my site: qwertyfree.choiceadaptive.com

function add_custom_id() {
  echo '<div id="my-main-content"></div>';
}

add_action('x_after_masthead_end', 'add_custom_id');

Hi There,

Please try with this code instead:

function add_custom_id() {
  echo '<div id="my-main-content"></div>';
}

add_action('x_before_site_begin', 'add_custom_id');

Let us know how it goes!

Perfect. Thanks so much!

Glad we were able to help :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.