• Hi, I’m trying to enter attribute: data-robot=”irobot”
    I put it in the Services section, and when I save, all data attributes are deleted … I do not understand why … and is there any way to enter data elements?

    I introduce it in the description of the services section of the main page of the template

    Thank you

    • This topic was modified 8 years, 5 months ago by millonario.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Theme Author FameThemes

    (@famethemes)

    Hi @millonario,

    The data-robot=”irobot” is not HTML tag so it does not work in section description.

    Thread Starter millonario

    (@millonario)

    thank you very much, it’s html5 I think .. it’s a shame for me it was important to insert that code ..

    Theme Author FameThemes

    (@famethemes)

    That is not HTML5 too. You can try this way:

    1. Create a new page with content you want.
    2. Install this plugin:
    https://ww.wp.xz.cn/plugins/post-content-shortcodes/
    3. Add shortcode to display page’s content in section description.

    That’s all.

    Let me know if it works!

    Thread Starter millonario

    (@millonario)

    Thank you so so so much 🙂

    It works great, I’m very grateful I was allowed to throw the project forward ^^

    I wish you every success in all your projects

    Theme Author FameThemes

    (@famethemes)

    @millonario:

    You’re welcome 🙂

    Please mark the topic is resolved. Thanks!

    Hi!

    I readed that it was solved, but I think the problem was the $allowedposttags variable.

    Try to add this to your functions.php

    
    if ( ! function_exists( 'extend_allowed_html_tags' ) ) {
    	function extend_allowed_html_tags() {
    		global $allowedposttags;
    
    		$allowedposttags['a']['data-robot'] = true;
    	}
    }
    add_action( 'init', 'extend_allowed_html_tags');
    

    To allow “data-whatever” or any other attrs.

    Theme Author FameThemes

    (@famethemes)

    @comecaramelos:

    Great idea!!

    Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Template automatically deletes data attribute’ is closed to new replies.