Enabling Skiplinks/ Accessibility in Pro

Hi!

I have activated the WP Accessibility plugin to enable some missing accessibility features to X. One of the options is the ability to turn on skip links. For that option, I need to enter the main content ID. I had been able to do this in the past using this line of code in Functions.php

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

However, this does not seem to be working anymore and I need to be able to add the custom id in order for the plugin to work across the whole site.

Please help!

Hey @RuhGlobalCommunicati,

I’ve tested that code in my test site and it still works.

It must be the WP Accessibility plugin that is not working anymore or your setup is incorrect as your simply adding an empty div with an ID above the content. Please contact the plugin developer to learn how to integrate their plugin to themes.

In case you want to assign an ID to the entry-content, you need to override the Global Content Template. To do that, please first learn how to override templates at https://theme.co/apex/forum/t/customizations-best-practices/205

Now that you know how to override a template, you just need to know what template to override. For this case, it’s the _content-the-content.php which can be found in framework\views\global. Remember that you need to copy that to the same folder structure in your child theme.

When you open the file you copied, you’ll see this line:

<div class="entry-content content">

Add and ID to it like:

<div id="my-content" class="entry-content content">

The rest is the plugin’s job so you’ll want to get in touch with the plugin developer too.

Hope that helps.

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