WordPress.org

Ready to get started?Download WordPress

Forums

Simple Links
[resolved] linking the title? (5 posts)

  1. AJ's WebCreations
    Member
    Posted 1 year ago #

    I like the look of this widget and wanted to see if it can do what I am looking for. I have two text box widgets and one link box widget in a side bar. I need to link the title of each to a page, I have found a text box widget that will let me make the title into a link but cannot find a link box widget the will let me make the title a link. I wanted to see if this could be done with yours or if not if you could maybe add that option?

    http://wordpress.org/extend/plugins/simple-links/

  2. Mat Lipe
    Member
    Plugin Author

    Posted 1 year ago #

    Hello DnA,

    It is possible to link the widget title using a built in filter titled 'simple_links_widget_settings'.

    Add this code to your theme's functions.php file and change the link to wherever you would like the title to link to and it should work just fine.

    add_filter('simple_links_widget_settings', 'sl_link_title');
    function sl_link_title( $instance ){
    
    	/** Url to where you want this to link to goes here **/
    	$link = "http://lipeimagination.info"; 
    
    	$instance['title'] = sprintf('<a href="%s">%s</a>', $link, $instance['title']);
    	return $instance;
    }

    This particular filter will change the link of the title in every Simple Links widget. If you would like to change a specific one or different links for different ones you will have to change the first line to match the id of the widget like so.
    add_filter('simple_links_widget_settings_simple-links-3', 'sl_link_title');

    Hope this helps.

  3. AJ's WebCreations
    Member
    Posted 1 year ago #

    Thanks for the fast reply I will try that.

  4. AJ's WebCreations
    Member
    Posted 1 year ago #

    This works but I can only see one link I imported them and it shows them in admin panel but when I go to the page it only shows 2 links. And only shows 2 link in firebug.

  5. AJ's WebCreations
    Member
    Posted 1 year ago #

    I got it figured out.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.