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!

Topic wysiwyg links Wordpress

Category Web


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


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');

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.


In the "tinyMCE Advanced" plugin has a special icon for that. The default WordPress installation don't offer the anchor icon/attribute editor.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.