Support » Theme: Astra » Как вставить тег в описание рубрики?

  • В теме astra не могу в описание рубрики вставить динамическую карту с тегом <iframe>, он просто вырезается. В других темах все нормально отображается. Как отключить обрезание тега?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello @rikitikitari

    We are not sure specifically of the issue you are facing.

    Can you help us with some screenshots or screencast so that we can take a look and help you accordingly?

    Looking forward to hearing from you!


    Thread Starter rikitikitari


    Hello @rikitikitari.

    By default, WordPress strips HTML from category and tag descriptions. This code will prevent that from happening.

     * Allow HTML in term (category, tag) descriptions
    foreach ( array( 'pre_term_description' ) as $filter ) {
    	remove_filter( $filter, 'wp_filter_kses' );
    	if ( ! current_user_can( 'unfiltered_html' ) ) {
    		add_filter( $filter, 'wp_filter_post_kses' );
    foreach ( array( 'term_description' ) as $filter ) {
    	remove_filter( $filter, 'wp_kses_data' );

    You may now use your IFRAME, but there is one issue – you cannot include HTTP pages into HTTPS pages and vice versa. So, the protocol (HTTP or HTTPS) for a parent and the embedded page should match.


    • This reply was modified 2 years, 5 months ago by hankev.

    This is not from WordPress. Not only because of WordPress.

    Thread Starter rikitikitari


    Many thanks
    In which place to insert this code?

    @rikitikitari Этот код для вставки в functions.php. Однако работать он не будет. Вы и сами убедились в этом, пробуя с другими темами. Надо поискать в теме Астра. Подождите, пожалуйста, ответа разработчиков.

    Hi @rikitikitari ,

    It seems like the customization that you wish to have does not come under our Astra purview. It’s a default WordPress behavior.

    But if you wish to override some feature, then you can do that by self coding, or you can hire a freelancer.

    Further, I saw the code that @hankev provides, and it’s working for me as well. You just need to add the code in the child theme’s function.php file. And then try to add the map iframe in the category description.


    This code allows HTML. Yes, he is working. But this is not enough (The code @hankev above does the same):

    remove_filter('pre_term_description', 'wp_filter_kses');
    remove_filter('term_description', 'wp_kses_data');

    The fact is that the iframe will not work.
    Personally, I do not need it. But I decided to see if this works. On a test site on a local server, I posted an iframe YouTube video.
    It works with other themes.

    Thread Starter rikitikitari


    I pasted this code in function.php file.
    Iframe in the category description is not work in – Astra, Twenty Twenty themes.

    Iframe in the category description is work in – Hestia, OceanWP themes without this code in function.php file.

    • This reply was modified 2 years, 5 months ago by rikitikitari.
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Как вставить тег в описание рубрики?’ is closed to new replies.