Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1176660

    Hallo,

    ich verwende das Widget Table of Content, Mega cool danke dafür.
    Ist es aber möglich anstatt den Kreisen die Überschriften zu Nummerieren automatisch? 1,2,3,4,5,6 usw?

    I’m using the Table of Content widget, mega cool thanks for that.
    But is it possible to automatically number the headings instead of the circles? 1,2,3,4,5,6 etc?

    https://www.dropbox.com/s/ei7xas4l3t31x5s/Bildschirmfoto-2020-01-21-um-10.48.12.png?dl=0

    Liebe Grüße

    #1177084

    Hello,

    can somebody help me?

    Best regards

    #1177205

    Hi,
    Thank you for the screenshot mockup, first add this css to remove the blue circles and gray line, Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:

    .avia-toc-style-elegant {
        padding-left: 0px !important; 
    }
    .main_color .avia-toc-style-elegant a:first-child:after, .main_color .avia-toc-style-elegant a.avia-toc-level-0:after {
        border-color: #fff !important;
    }
    .main_color .avia-toc-style-elegant a:before {
        border-color: #fff !important; 
    }

    Then to add a number before each TOC link Try adding this code to the end of your functions.php file in Appearance > Editor:

    function custom_toc_script(){
      ?>
      <script>
    (function($){
      $(document).ready(function(){
    var i = 0;
    $('a.avia-toc-link').each(function(index, element){
        i++;
        $(element).text(i + '. ' + $(element).text());
    });
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_toc_script');

    unfortunately, since the number is added to the link we can not change the color to red as in your mockup, I also only tested this on a TOC with no childern, as in your mockup.
    This is the expected results:
    2020-01-22-075045
    Please clear your browser cache and check.
    If this doesn’t help please include the url to the page in question so we can take a closer look.

    Best regards,
    Mike

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.