• Hi, I love this plugin, it’s a great alternative to one I’m already using.

    I have thousands of posts already created on my site and going back in and adding this shortcode to each and every one would be a huge hassle. Is there any way I can insert the post title dynamically into the shortcode so the keyword is set as that specific post’s title?

    https://wordpress.org/plugins/ebay-feeds-for-wordpress/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Rhys Wynne

    (@rhyswynne)

    Hi there,

    There isn’t a way to add the post title dynamically to it. However, can you edit the template? I have hacked together some code so that you can use the function in something like your single.php to add this to all posts.

    Plugin Author Rhys Wynne

    (@rhyswynne)

    If not, I could create a ticket that could find a way to add this, but this will be a few months down the line.

    Thread Starter burlyqlady

    (@burlyqlady)

    Hi again! I don’t know why I didn’t get your reply in my inbox 🙁 I just now saw it so sorry for the delay in responding!

    Yes, I definitely have access to the template and can edit it. I’d love to try your “hack” to get this to work 😀

    Plugin Author Rhys Wynne

    (@rhyswynne)

    Hi 🙂

    Right try this:-

    <?php
    $search = str_replace( " ", "+", get_the_title() );
    $feedurl = "http://rest.ebay.com/epn/v1/find/item.rss?keyword=".$search."&categoryId1=64482&sortOrder=BestMatch&programid=15&campaignid=5336773602&toolid=10039&listingType1=All&lgeo=1&descriptionSearch=true&feedType=rss"
    
    ebay_feeds_for_wordpress($feedurl,15); 
    
    ?>

    Right this code is pretty much a hack, so it comes as is, it may work for you, but may not 🙂

    Plugin Author Rhys Wynne

    (@rhyswynne)

    Also,

    You’ll have to change the $feedurl to the one you have, as it’s set up for my site, so includes my affiliate link and only searches certain categories.

    Thread Starter burlyqlady

    (@burlyqlady)

    Cool. I just add that where I want it in the single.php template?

    Plugin Author Rhys Wynne

    (@rhyswynne)

    Yeah. I think you may need it in the loop though. Outside the loop I guess this would work:-

    <?php
    global $post
    $post_id = $post->ID
    $search = str_replace( " ", "+", get_the_title( $post_id ) );

    and then carry on with the rest of the code….

    Thread Starter burlyqlady

    (@burlyqlady)

    Great, I’ll give it a try and let you know how it goes.

    Thread Starter burlyqlady

    (@burlyqlady)

    Darn, i thought it would work. It doesn’t seem to. Thanks for your help anyway :/

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Inserting post title as keyword’ is closed to new replies.