WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Add hyperlink to get recent comments widget title (3 posts)

  1. JaneLitte
    Member
    Posted 6 years ago #

    I want to use the Widgetized version of "get recent comments" but add a hyperlink to the title. I looked at the plugin and found this portion of the code:

    function kjgrc_get_option($section,$option_name)
    {
    	global $wpdb,$kjgrc_options_loaded;
    	$version = 11; // If version differs from saved value -> insert new defaults
    	$kjgrc_options = get_option("kjgrc_options");
    	if ($kjgrc_options == NULL || $kjgrc_options['version'] != $version)
    	{
    		$default_options = array (
    			"grc_max_comments" => 5,
    			"grc_chars_per_comment" => 120,
    			"grc_chars_per_word" => 30,
    			"grc_format" => "<li><a href=\"%comment_link\" title=\"%post_title, %post_date\">%comment_author</a>: %comment_excerpt</li>",
    			"grc_grouped_by_post" => 0,
    			"grc_grouped_by_post_a" => '<li><strong><a href="%post_link" title="%post_title was posted on %post_date">%post_title</a>&nbsp;(<a href="#" title="There are %post_counter comments to this posting">%post_counter</a>)</strong><ul>',
    			"grc_grouped_by_post_b" => '</ul></li>',
    			"grc_show_trackbacks" => 0,
    			"grc_comments_per_post" => 5,
    			"grc_limit_comments_per_post" => 0,
    			"grc_exclude_blog_owner" => 0,
    			"grc_exclude_blog_owner2" => 0,
    			"grt_max_comments" => 5,
    			"grt_chars_per_comment" => 120,
    			"grt_chars_per_word" => 30,
    			"grt_format" => "<li><a href=\"%comment_link\" title=\"Trackback to &quot;%post_title&quot;: %comment_excerpt\">%comment_author</a>: %trackback_title</li>",
    			"misc_exclude_cat" => "",
    			"misc_exclude_cat_reverse" => 0,
    			"misc_convert_smileys" => 1,
    			"gravatar_size" => 20,
    			"gravatar_alt_url" => "",
    			"grt_ignore_ip" => "",
    			"gravatar_rating" => 0,
    			"grc_sidebar_title" => "Recent Comments",
    			"grt_sidebar_title" => "Recent Trackbacks"
    		);

    I changed this:
    "grc_sidebar_title" => "Recent Comments",

    to this:

    "grc_sidebar_title" => "<a href=\"http://dearauthor.com/wordpress/discussionpage\">Recent Comments</a>",

    But it doesn't seem to work. Any suggestions?

  2. JaneLitte
    Member
    Posted 6 years ago #

    oh good lord, the solution was just to add the hyperlink in the 'title' portion of the widget.

  3. Driftless
    Member
    Posted 5 years ago #

    And how does one do this?

    I have tried entering Widget Title but it strips the tags and just prints it.

    Is this just me?

Topic Closed

This topic has been closed to new replies.

About this Topic