• Resolved q292u

    (@q292u)


    Hi. I’m looking to call this from my single-post page, after the post contents, rather than using the short code or widget.
    What is the PHP code to do this? (Including parameters)

    Thanks in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter q292u

    (@q292u)

    bump

    Plugin Author Arthur Yarwood

    (@arfa_)

    Hi there,
    I would recommend you use the WordPressw do_shortcode function to parse a string with a shortcode defined in it and return the resultant string from my plugin. See: https://developer.www.ads-software.com/reference/functions/do_shortcode/

    This would be preferable to calling php functions/classes defined within my plugin directly. As the underlying code in my plugin may change over time, whereas the shortcode syntax being a public interface will remain fixed and be maintained long term.

    Does that make sense? Does that work for you?
    Regards,
    Arthur.

    Thread Starter q292u

    (@q292u)

    Hi Arthur, thanks for getting back to me.
    I think your solution would work, BUT it turns out that what I was trying to achieve doesn’t work, anyway.

    Here’s the scenario:
    I have a website that creates posts automatically from an eBay feed. What I was trying to do was use one of your widgets on the single post page to automatically display related ebay listings.
    I found a way to place a dynamic search widget after the post content, BUT the widget uses the post title, and it’s too specific – it usually only returns one post: the one with that exact title.. not useful..

    Example: title= “1980 Mercedes W107 blah blah2”. I need to be able to search for similar items, not the exact same one.

    Plugin Author Arthur Yarwood

    (@arfa_)

    Ah I see now. Sorry, no there’s no functionality in the plugin to perform a related items search of ebay.

    Thread Starter q292u

    (@q292u)

    Actually, there sort-of is..
    If I could call the dynamic search via a php call and pass it the keywords (saved as custom fields attached to the post?).
    Hence my original request, although I probably could have been clearer..

    Then all I need is a way to populate the custom field from the RSS feed. Which is my problem..

    What do you think?

    Plugin Author Arthur Yarwood

    (@arfa_)

    eBay have just announced they are planning to decomission the RSS dynamic feed tools, as such you’re planned development here will not work long term. I suggest you look at alternative approaches to your requirements.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Embedding in a theme file (PHP code)’ is closed to new replies.