• I’ve got an installation of WordPress running through Yahoo Hosting. Since Yahoo doesn’t allow its customers to edit the .htaccess files (boo!), I’ve had to employ a workaround in which I change the blog address in the WP options to include index.php. This make all of my permalinks look something like this :

    https://www.blahblahblah.com/index.php/about/

    Kinda lame, but it works. The issue I’m having, however, is that while this seems to fix 90% of the links within the site, the links generated by the Get Recent Comments plugin are still broken. I started digging through the plugin source code hoping to find an easy way to fix it, but it seems like the critical function from the plugin is here :

    $post_link = get_permalink($comment->comment_post_ID);

    For some reason, the URLs generated by this aren’t including the /index.php/. I’ve tried adjusting the WP options to include and remove a trailing slash, but neither seems to work. My guess is that the majority of the sites other internal links are generated within “The Loop” and are done using the the_permalink() function, unfortunately, that function won’t work for the recent comments.

    So, is there any way to make this work? Is there another permalink function I can swap out? Or is there a fix for this somewhere that I can try?

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter waltisfrozen

    (@waltisfrozen)

    After looking into this further, I think the issue may be with one of the functions of Get Recent Comments itself, rather than any differences between get_permalink() and the_permalink(). Although the links generated by the plugin were missing the URI specified above, the code that was generated in the sample that’s seen on the Options -> Recent Comments page had properly formatted URLs. To get around this, I simply swapped out the function that creates the actual recent comments code on the site with the function that creates the sample. This :

    function get_recent_comments()
    {
    echo kjgrc_cache(“comments”);
    }

    …becomes this :

    function get_recent_comments()
    {
    echo kjgrc_create_recent_comments(“comments”);
    }

    I’m not all that familiar with the detailed differences between these two functions that would make one work and one not, so if anyone else has this problem and decides to employ this workaround, I’d suggest closely monitoring your site for any potential problems.

Viewing 1 replies (of 1 total)
  • The topic ‘Get_permalink issue with Get Recent Comments plugin.’ is closed to new replies.