Posts in Sidebar
[resolved] copyright icon in widget title (2 posts)

  1. zapster_65
    Posted 1 year ago #

    I'd first like to say -thank you!!!
    This is an awsome piece of work - I love it!

    But I do have a problem with the widget-title.
    I need to place a copyright icon ('®'-html-tag) into the title of the widget in '<sup> </sup>' to make the icon smaller and place it in the right position. The icon itself shows up, but unfortunately the '<sup> </sup>' got stripped off, so the icon shows up as large as a normal letter wich is not looking very nice. Is there a possibility to get around this problem?

    Thanks for the help.


  2. aldolat
    Plugin Author

    Posted 1 year ago #

    I'm happy you appreciate this plugin! :)

    About your question, for security reasons every input coming from the user must be sanitized, so it's not possible to allow an HTML tag in the title. I'm very sorry for this.

    Anyway, there is a workaround that could be useful for you. Take note that this change will occur in every title of every widget.

    All titles of the widgets are passed through a filter, so you could filter (change) the output. We'll add a symbol at the end of the title. Open the functions.php of your current theme and add these lines at the end:

    function add_something_to_widget_title( $title ) {
    	return $title . '<sup>®</sup>';
    add_filter( 'widget_title', 'add_something_to_widget_title' );

    When you add these lines, be sure to paste them before the closing PHP tag ?>, if any.

    Save the file and test it.

    Let me know.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posts in Sidebar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic