Skip to main content
Post Closed as "Needs details or clarity" by Dave Romsey, cjbj, bueltge, fuxia
spelling mistake
Source Link
Rikki
  • 131
  • 8

I'm pretty new to Wordpress and I'm a bit stuck.

I have created a site and I'm linking to Amazon. I read their ToS and I'm not allowed to hardcode the price in because of price fluctuations. I signed up to the API and got my key and have programmed a function to query the API for the price of an item using the ASIN. This works fine, but when I try to use it in a post it doesn't work.

I downloaded the "Insert PHP" plugin so I can use shortcode to call my function and echo out the price.

This works partially, but when I echo the returned string it's wrapped in <p> tags so I cannot echo it out in a <h2> tag properly.

How can I get this to work? Is there a way I can echo it out withwithout being wrapped in the <p> tags?

Thanks

I'm pretty new to Wordpress and I'm a bit stuck.

I have created a site and I'm linking to Amazon. I read their ToS and I'm not allowed to hardcode the price in because of price fluctuations. I signed up to the API and got my key and have programmed a function to query the API for the price of an item using the ASIN. This works fine, but when I try to use it in a post it doesn't work.

I downloaded the "Insert PHP" plugin so I can use shortcode to call my function and echo out the price.

This works partially, but when I echo the returned string it's wrapped in <p> tags so I cannot echo it out in a <h2> tag properly.

How can I get this to work? Is there a way I can echo it out with being wrapped in the <p> tags?

Thanks

I'm pretty new to Wordpress and I'm a bit stuck.

I have created a site and I'm linking to Amazon. I read their ToS and I'm not allowed to hardcode the price in because of price fluctuations. I signed up to the API and got my key and have programmed a function to query the API for the price of an item using the ASIN. This works fine, but when I try to use it in a post it doesn't work.

I downloaded the "Insert PHP" plugin so I can use shortcode to call my function and echo out the price.

This works partially, but when I echo the returned string it's wrapped in <p> tags so I cannot echo it out in a <h2> tag properly.

How can I get this to work? Is there a way I can echo it out without being wrapped in the <p> tags?

Thanks

Source Link
Rikki
  • 131
  • 8

PHP in post content

I'm pretty new to Wordpress and I'm a bit stuck.

I have created a site and I'm linking to Amazon. I read their ToS and I'm not allowed to hardcode the price in because of price fluctuations. I signed up to the API and got my key and have programmed a function to query the API for the price of an item using the ASIN. This works fine, but when I try to use it in a post it doesn't work.

I downloaded the "Insert PHP" plugin so I can use shortcode to call my function and echo out the price.

This works partially, but when I echo the returned string it's wrapped in <p> tags so I cannot echo it out in a <h2> tag properly.

How can I get this to work? Is there a way I can echo it out with being wrapped in the <p> tags?

Thanks