Support » Theme: Crio » Crio HTML Tags and Attributes

  • I have a Crio blog page. After the “Leave a Reply” it says “You may use these HTML tags and attributes.
    What I would like the commenter to be able to do is simply edit by clicking “Bold” or “Link” etc. How can this type of editing menu be applied to my blog posts instead of HTML

    Example of the HTML tags and Attributes on my blog post.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello,

    To add visual editing elements to blog comments, you will need to add a filter to the theme. We recommend using the Code Snippets plugin to do so.

    The reason we recommend using a plugin to create new filters instead of editing your theme files directly is that it allows your custom code to persist through theme updates. Custom modifications to your theme files will be overwritten when you eventually update your theme.

    Once you have your preferred code manager installed you can create a new entry with the following snippet:

    add_filter( 'comment_form_defaults', 'rich_text_comment_form' );
    function rich_text_comment_form( $args ) {
    	ob_start();
    	wp_editor( '', 'comment', array(
    		'textarea_rows' => '10', // re-size text area
    		'dfw' => false, // replace the default full screen with DFW (WordPress 3.4+)
    		'tinymce' => array(
            	'theme_advanced_buttons1' => 'bold,italic,underline,strikethrough,bullist,numlist,code,blockquote,link,unlink,outdent,indent,|,undo,redo,fullscreen',
      	  	),
    		'quicktags' => array(
     	       'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close'
    	    )
    	) );
    	$args['comment_field'] = ob_get_clean();
    	return $args;
    }

    You will now have a toolbar above the blog comment box like this:

    Hope this helps, please let us know!
    Thanks,
    Nicole

    Thread Starter jg100

    (@jg100)

    Hi Nicole,

    Thank you for the help with this. I installed and activated the Code Snippets Plugin. I copied/pasted your snippet/Edit Example HTML Shortcode/Save and Activate and got the following message about a fatal Error.

    Fatal Error Message

    Snippet Code

    Thread Starter jg100

    (@jg100)

    Update:

    Instead of the HTLM Snippet, I used the CSS Snippet and it worked.

    Thank you for your help Nicole.

    Hello,

    It looks like some special characters accidentally made it into the first snippet, but glad you got it to work!

    Nicole

    Hi, I just have the same problem, I installed the plgin, the code and have the toolbar, now…How do I delete the message
    “You may use these HTML tags and attributes:

    <abbr title=””> <acronym title=””> <b>

    <cite> <i> <q cite=""> <s> <strike> "

    Thanks

    Hi @maogilc1

    Thanks for the question! The code in mentioned above will enable the visual editor for comments. In order to hide the “HTML Attributes and Tags” section, you can use this CSS snippet in your Customize > CSS/JS Editor > CSS code section:

    #commentform .form-allowed-tags,
    #commentform .alert {
        display: none;
    }
    

    Wow!, thank you so mucho, It was driving me nuts and some users were “suggesting” me to remove it. I really appreciate your help!

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