• Hello Alexander (please sorry about my bad English)

    I need to insert images in the TAG description. Unfortunately, when I insert an image, Worpdress transforms the HTML code like this:

    <img src=\"https://dev.mysite.com/wp-content/uploads/2023/04/my-image.jpg\" alt=\"my image\" width=\"750\" height=\"419\" />

    I googled for a whole day for possible solutions and found various codes to add to the functions.php file

    I used the code suggested by WooCoomerce here https://woocommerce.com/document/allow-html-in-term-category-tag-descriptions/

    I also tried this code

    add_filter('wp_kses_allowed_html', function ( $allow ) {
      if ( is_admin()) $allow['img'] = ['src' => true, 'alt'=> true, 'width'=> true, 'height'=> true,];
      return $allow;
    });

    Or this:

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

    But nothing works. Is there any way to add images in the TAG description? Maybe it’s possible to do it with the pro version of the theme?

    Kind regards and sorry again for my bad English.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author Alexander Agnarson

    (@alxmedia)

    Hi! Your English is great, so no need to worry about that!

    When you say TAG description… do you mean post tag pages title descriptions or something that has to do with meta sharing tags? Or something else? Do you have any link where I can read about what you mean?

    There is no pro version of this theme, and the usage you are asking for is most likely plugin territory.

    Thread Starter MaxStirner

    (@maxstirner)

    Hello Alexander, thanks for your quick reply!

    A link to help you understand better is this: https://www.thepixelpixie.com/enabling-html-in-your-category-taxonomy-descriptions/

    Plus, to explain myself better, I add a screenshot of what I would need.

    Adding text is no problem. It’s also possible to add HTML code with those scripts from my first post (text style or similar) but it doesn’t accept the img src code.

    I understand I’m asking for something you probably don’t have to answer me about, so it’s perfectly fine if you want to close it here. Unfortunately, I didn’t find any plugins, but they all suggest implementing some code in the theme.

    • This reply was modified 3 years, 2 months ago by MaxStirner.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Use Images in Tag Page description’ is closed to new replies.