-
HI, I found an article that enables you to get rank math to recognise custom TOC plugins. However, I am using a JS function. What would I need to get rank math to recognise this? Thanks, Cali
(function ($) {$('#main').find('h2').each(function() {
var $item = $(this);
var $id = $(this).attr('id');
var li = $('<li/>');
var a = $('<a/>', {text: $item.text(), href: '#' + $id, title: $item.text()});
a.appendTo(li);
$('#main .toc ul').append(li);
});})(jQuery);
which I load through functions using this:
wp_register_script('toc', get_stylesheet_directory_uri() . '/assets/js/toc.js', array(), false, true);
wp_enqueue_script( 'toc' );
The ticket ‘Recognise Custom Toc Function’ is closed to new replies.