WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. zapster_65
    Member
    Posted 6 months 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.

    http://wordpress.org/plugins/posts-in-sidebar/

  2. aldolat
    Member
    Plugin Author

    Posted 6 months ago #

    Hi,
    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.

Reply

You must log in to post.

About this Plugin

About this Topic