• Resolved jiteshcatena

    (@jiteshcatena)


    Hello Team,

    Thanks for this great plugin and I love it!

    I need different icons for title, please review below screenshot link for more clarity.

    https://prnt.sc/j4NXcW7NY6pM

    Is there any way we can achieve this goal?

    Thanks for your help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WPJoli

    (@wpjoli)

    Hello,

    Thank you for nice comment, appreciate it.

    If you want to add custom icons in front of each heading, you can customize the output by using the joli_toc_headings filter.

    You would need to add custom HTML before each heading.

    Example:

    add_filter('joli_toc_headings', 'edit_headings', 10, 2);
    
    // Example how to add a custom icon to all headings
    function edit_headings( $headings ){ 
        $headings = array_map(function($heading){
                //edit title and add custom icon in front
                $heading['title'] = '<span class="custom-icon"></span> .' heading['title'];
            return $heading;
        }, $headings);
     
        return $headings;
    }

    However in the above example, the same icon is applied to each heading. You need to adapt the code to what you are looking to achieve.

    I hope this answers your question.

    Cheers !

    • This reply was modified 1 year, 1 month ago by WPJoli.
    Plugin Author WPJoli

    (@wpjoli)

    I will mark this topic as resolved

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need different Icons for Title’ is closed to new replies.