Create anchor from Wysiwyg editor

Is there any way to create internal anchors without using the HTML rendering option?
I don’t mind but I guess my customer will 😉

Thanks!

Related posts

Leave a Reply

4 comments

  1. Building off of mike23’s answer. Here you can just append the anchor button to the wysiwyg panel.

    function set_tinymce_buttons( $initArray ) {
        $initArray['theme_advanced_buttons1'] .= ',anchor';
        return $initArray;
    }
    add_filter('tiny_mce_before_init', 'set_tinymce_buttons');
    
  2. Here’s a simple non-plugin solution, you can paste this into your functions.php :

    function set_tinymce_buttons( $initArray ) {
        $initArray['theme_advanced_buttons1'] ='formatselect,|,bold,italic,underline,|,bullist,numlist,charmap,|,pastetext,pasteword,|,removeformat,|,anchor,link,unlink,|,undo,redo';
        $initArray['theme_advanced_buttons2'] = '';
        $initArray['theme_advanced_blockformats'] = 'h2,h3,h4,p';
        return $initArray;
    }
    add_filter('tiny_mce_before_init', 'set_tinymce_buttons');
    

    With that you can set the two lines of buttons as well as the tags in the Format dropdown.

    See this page for options.

  3. you can easily create bookmarking tag just follow these steps :

    1. Set your Destination

      <h2 id="anchor"> Destination of your Anchor </h2>
      
    2. Make target Hyperlink

      <a href="#anchor">Click Me for check our Anchor</a>
      

    enter image description here

    please see above image for better explanation