Support » Plugin: Amazon Link » Amazon Prices in Titles

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author paulstuttard


    Hi Raúl,

    There are a number of ways to add this functionality…


    You could hack it into the plugin by editing the file ‘amazon.php’, find the line:

    add_filter('the_content', array($this, 'content_filter'),15,1);             // Process the content

    and adding the line immediately after it:

    add_filter('the_title', array($this, 'content_filter'),15,1);             // Process the title


    However if you upgrade the plugin this will be lost, so you could add the following into some plugin or theme file e.g. in ‘functions.php’ add:

    function add_amazon_titles ($opts, $al) {
       add_filter('the_title', array($al, 'content_filter'), 15,1);
    add_action ('amazon_link_init', 'add_amazon_titles', 10,2);


    Or you change your themes template to call the Amazon Link plugins functions directly, e.g. in your themes ‘single.php’ files where it displays the title add some code like:

    $ASIN = get_the_title();
    if (function_exists(amazon_shortcode)) echo amazon_shortcode("template=price&asin='$ASIN'");

    Just some ideas, I haven’t tested them thoroughly!


    Sorry for this late resp

    Thank you very much for all the solutions provided. I tried about 1 month ago your solutions but they didn’t worked and I quit trying for a while. Today I decided to try again and now I figured out what I was doing wrong, my mistake was that in my code this line

    add_filter('the_content', array($this, 'content_filter'),15,1);

    is like this
    add_filter('the_content', array($this, 'content_filter'),15);

    and each time I was adding this line
    add_filter('the_title', array($this, 'content_filter'),15,1);

    I was getting a global error. Today I’ve modified this
    add_filter('the_title', array($this, 'content_filter'),15,1);
    to this
    add_filter('the_title', array($this, 'content_filter'),15);
    and voilá! I have the prices in my article titles.

    Thank You very much!!

    P.S: sorry my english, I hope is good enought to be understood

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Amazon Prices in Titles’ is closed to new replies.