Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #1194329

    if i use chinese words on tag H1 H2,
    the table of contents can’t catch H1 H2
    but use english word is ok.
    please fix that.
    thanks.

    #1194414

    Hey Moaaaaya,

    Where can we see and reproduce the problem you are having?

    Best regards,
    Rikard

    #1194669

    hello, here is the url .

    #1195331

    up up

    #1196390

    Hi Moaaaaya,

    Could you please attach some screenshots of the issue?

    What do you mean by “the table of contents can’t catch H1 H2”? How do you need it to be?

    Best regards,
    Victoria

    #1196407

    #1196921

    Hi Moaaaaya,

    Thank you, but what really is the problem? Can you please explain a bit more?

    Best regards,
    Victoria

    #1197543

    hello,I think it’s should be p=382#標題
    not
    p=382#

    • This reply was modified 4 years, 8 months ago by Moaaaaya.
    #1197663

    Hi,

    I’m not sure if Chinese characters are supported in general to be honest with you: https://electrictoolbox.com/valid-characters-html-id-attribute/. Does it work if you try to link to it manually?

    <a href="your.site/p=382#標題">Anchor link</a>

    Best regards,
    Rikard

    #1197908

    hello
    i made link by manually
    that looks ok.
    so there have a problem on TABLE OF CONTENTS when h1,2,3,4,5 title is use chinese.
    http://51.dr104.com.tw/?p=382

    • This reply was modified 4 years, 8 months ago by Moaaaaya.
    #1198728

    Hi,
    Sorry for the late reply, this function will add the text character to the url of the TOC so the anchor links will work, unfortunately this will only work if the whole TOC is Chinese, because it brakes the English links.
    Try adding this code to the end of your functions.php file in Appearance > Editor:

    function custom_toc_script(){
      ?>
      <script>
    (function($){
      $(document).ready(function(){
      $(".avia-toc-container a.avia-toc-link").each(function(){
        var character = $(this).find("span").text();
        $(this).attr('href', function() {
        return "#" + character;
    });
    });
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_toc_script');

    Please let us know if you want to use English and Chinese TOC’s on the same site, we can have this code only work on the pages to have the Chinese TOC.

    Best regards,
    Mike

    #1198999

    hello,it’s not work.
    I give you the Site ID & PASSWORD on private content.
    you can take a look,thanks.

    #1199052

    Hi,
    Thank you for the link, I see your site is getting the error jQuery is not defined and your theme options are not showing the option Enfold Theme Options > Performance > Load jQuery in your footer
    2020-03-30_055544.jpg
    This is a sign that your webhost has set your scripts to be loaded in the footer, which brakes the jQuery.
    There are different scripts that your webhost can use to move the jQuery to the footer, please ask them to remove their code, probably in the “wp-config.php” file.

    Best regards,
    Mike

    #1199259

    jQuery is loaded

    hello please have a check.
    thanks.

    #1199317

    Hi,
    Thank you for getting this option displayed, did they tell you how they had done it? We want it disabled so I did that for you. It seems the sidebar was loading after the script ran, so I added a delay to the script, now it’s working fine.
    Please clear your browser cache and check.

    The final code:

    function custom_toc_script(){
      ?>
      <script>
    (function($){
      $(document).ready(function(){
    	  setTimeout(function () {
      $(".avia-toc-container a.avia-toc-link").each(function(){
        var character = $(this).find("span").text();
        $(this).attr('href', function() {
        return "#" + character;
    });
    });
    		  }, 2000);
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_toc_script');

    Best regards,
    Mike

    #1199598

    thanks,but it’s not scroll when I press it.

    #1200504

    Hi,
    Sorry for the late reply, I see you are now getting the error “Cannot read property ‘top’ of undefined” when the links are clicked, it seems related to the language, for example when I copy the link I get this:
    http://51.dr104.com.tw/?p=382#%E6%A8%99%E9%A1%8C%E4%B8%89 instead of:
    http://51.dr104.com.tw/?p=382#標題三

    Best regards,
    Mike

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