• Glad you fixed the “tags for links without queries” problem!

    The other change I’ve made to your excellent plug-in was to enable it for comments as well as for posts:

    /**
     *Add Affiliate Tags to Amazon Links in Comments
     *(for Amazon Affiliate Tags Plug-In)
    **/
    if ( function_exists( 'AddTag') ) {
    add_filter('comment_text', 'AddTag');
    }

    I add that to functions.php, though in the past have also hacked the filter directly into amazify.php. Have not noticed any decline in performance.

    https://www.ads-software.com/plugins/amazify/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    is it possible to add tags to links on a page? It’s working great for posts, but I have some Amazon links on various page that aren’t being tagged automatically.

    Thanks

    Thread Starter CK MacLeod

    (@ck-macleod)

    Might be a question for the developer – though I’m curious, and wondering how the pages you’re describing are rendered: If they utilize the WordPress Loop, then I believe the plug-in should handle them the same way that it handles posts via “the_content” filter.

    My theme comes with a couple shortcodes for displaying a set number of post excerpts in rows (e.g. The ten most recent blog posts)

    The Amazon affiliate links are in the excerpt and they don’t get auto-tagged. Thanks for replying anyway, I’ll try contacting the dev.

    Thread Starter CK MacLeod

    (@ck-macleod)

    You might try:

    /**
     *Add Affiliate Tags to Amazon Links in Excerpts
     *(for Amazon Affiliate Tags Plug-In)
    **/
    if ( function_exists( 'AddTag') ) {
    add_filter('the_excerpt', 'AddTag');
    }

    Note: I haven’t tested it, and it’s possible that filters or other peculiarities of the set-up might remove the tags (or cause other problems!). Shouldn’t take very long to check out though.

    Thank you very much, I’ll test this tomorrow. Just checking that all I need to do is throw it in my child theme?

    Thread Starter CK MacLeod

    (@ck-macleod)

    Right – in its functions.php file. Please be very careful when editing… have a backup ready to upload etc. – cuz a single missing punctuation or other error can break your site!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add tags to links in comments’ is closed to new replies.