Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Place Search Field within PHP block
This topic contains 9 replies, has 2 voices, and was last updated by IchoMusic 9 years ago.
- AuthorPosts
- September 16, 2014 at 11:21 am #2453
Hi,
I’m trying to place the search field into a template file.
I’ve tried the php code provided but in the place I need to add it … it seems to have an error.Please find screenshot attached … on line 103 you can see the php search code … and the above and below lines are for a surrounding span.
I’m assuming the search code needs adjusting to fit into this part of the php file but not sure to what?
If you could have a quick look that would be great.
Thanks
NickSeptember 16, 2014 at 11:41 am #2454Hi!
Could you please upload the screenshot again? It seems like there is a bug in the support ticket open page.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 16, 2014 at 11:46 am #2455No probs … here it is again … or have uploaded to our staging site here: http://nptravel2.staging.wpengine.com/wp-content/uploads/NPT-SearchPlacement.jpg
Attachments:
You must be logged in to view attached files.September 16, 2014 at 11:58 am #2457Okay, it’s uploaded fine now. I think the problem is that the entire code is echoed inside the span element. As far as I know only inline elements can be placed inside other inline elements in HTML, so that’s probably the problem. The search code contains divs, images, forms and those elements are invalid inside a span.
Try to change the span to a div and it should work properly then. You might as well need to change or add a few lines to your CSS to get the positioning right.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 16, 2014 at 12:07 pm #2458Hi,
Thanks for having a look.
I’ve adjusted the code … does this look correct on lines 111 – 114
I’ve screenshot the html output (highlighted so you can see the output) in another attached screenshot.
Am I doing something wrong.
Attachments:
You must be logged in to view attached files.September 16, 2014 at 12:11 pm #2461The code is incorrect, it’s missing the [ ] tags.
echo do_shortcode('[wpdreams_ajaxsearchpro id=1]');
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 16, 2014 at 12:16 pm #2462Hi,
Sorry … I must have copied the wrong bit of code from the documentation.
All working now … thank you!
September 16, 2014 at 12:20 pm #2463No problem at all.
Best,
Indeed it’s incorrect in the documentation! Thank you for pointing that out.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 16, 2014 at 12:29 pm #2464Hi Again,
Please can I quickly ask how to remove the drop down icon. It’s the down arrow icon in the ‘NPT-icon” screenshot.
The other two screenshots show the settings, which are turned off, but you can see the theme icon is still showing.
Thanks for your help
-
This reply was modified 9 years ago by
IchoMusic.
Attachments:
You must be logged in to view attached files.September 16, 2014 at 12:34 pm #2469Update – I just tried this setting .. attached .. and it seems to have removed the icon … not sure why but it’s worked.
-
This reply was modified 9 years ago by
- AuthorPosts
You must be logged in to reply to this topic.