Automatic wrapper and for H2 headings

Posted in: Newspaper
Post count: 64

Hello,

I’m using the Newspaper theme https://forcenews.pl and I’m trying to improve the accessibility, SEO, and deep linking of my articles and event posts https://forcenews.pl/kalendarz-wydarzen/.

My Goal:
I need two things to happen automatically:

The entire content of every post to be wrapped in <article class=”article”> (if it’s missing).

Every H2 heading to be automatically wrapped in a <section> tag with a synchronized aria-labelledby attribute and a unique id for the heading itself.

Desired Output for H2:

html
<article class=”article”>
<!– other content –>
<section aria-labelledby=”unique-heading-id”>
<h2 id=”unique-heading-id”>My Heading Text</h2>
…paragraph content…
</section>
</article>
My Question:
Does the Newspaper theme or TagDiv Composer have a built-in feature to handle this automatically?

If not, could you please provide a reliable PHP code snippet (for the functions.php file) that accomplishes both points? I need it to work retroactively for all existing articles and future articles without any manual editing.

Thank you for your excellent support and a great theme!

Post count: 35449

Hi,
I’m sorry, but our theme does not have such a feature, also, I don’t have the expertise to implement it myself. You would need custom development work, which can be done by a developer.

Thank you!

Post count: 64

ok, thank you.

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.