I would like to make a small change in a code for a table of contents.
I want to add a sign in front of each heading. The character should be recognized as text.
I’ve tried a few things, but unfortunately I have not found the right variable.
The code comes from a plugin for WordPress
I have already tried the following variables:
$ items $ tic $ find $ replace $ post
Here is the code that prints the list:
if ( $ tic->is_eligible($ custom_toc_position) ) { extract( $ args ); $ items = $ tic->extract_headings( $ find, $ replace,wptexturize($ post->post_content) ); $ title = ( array_key_exists('title', $ instance) ) ? apply_filters('widget_title', $ instance['title']) : ''; if ( strpos($ title, '%PAGE_TITLE%') !== false ) $ title = str_replace( '%PAGE_TITLE%', get_the_title(), $ title ); if ( strpos($ title, '%PAGE_NAME%') !== false ) $ title = str_replace( '%PAGE_NAME%', get_the_title(), $ title ); $ hide_inline = $ toc_options['show_toc_in_widget_only']; $ css_classes = ''; // bullets? if ( $ toc_options['bullet_spacing'] ) $ css_classes .= ' have_bullets'; else $ css_classes .= ' no_bullets'; if ( $ items ) { // before widget (defined by themes) echo $ before_widget; // display the widget title if one was input (before and after titles defined by themes) if ( $ title ) echo $ before_title . $ title . $ after_title; // display the list echo '<ul class="toc_widget_list' . $ css_classes . '">' . $ items . '</ul>'; // after widget (defined by themes) echo $ after_widget; }
I tried it like this:
$ items = '>'.$ items $ tic = '>'.$ tic $ find = '>'.$ find . . .
Unfortunately, nothing has hit the right place $ items addressed only the entire list The other Variables had no effect or led to errors