Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Place Search Field within PHP block
- This topic has 9 replies, 2 voices, and was last updated 11 years, 8 months ago by
IchoMusic.
-
AuthorPosts
-
September 16, 2014 at 11:21 am #2453
IchoMusic
ParticipantHi,
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 #2454Ernest Marcinko
KeymasterHi!
Could you please upload the screenshot again? It seems like there is a bug in the support ticket open page.
September 16, 2014 at 11:46 am #2455IchoMusic
ParticipantNo probs … here it is again … or have uploaded to our staging site here: http://nptravel2.staging.wpengine.com/wp-content/uploads/NPT-SearchPlacement.jpg
September 16, 2014 at 11:58 am #2457Ernest Marcinko
KeymasterOkay, 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.
September 16, 2014 at 12:07 pm #2458IchoMusic
ParticipantHi,
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.
September 16, 2014 at 12:11 pm #2461Ernest Marcinko
KeymasterThe code is incorrect, it’s missing the [ ] tags.
echo do_shortcode('[wpdreams_ajaxsearchpro id=1]');September 16, 2014 at 12:16 pm #2462IchoMusic
ParticipantHi,
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 #2463Ernest Marcinko
KeymasterNo problem at all.
Indeed it’s incorrect in the documentation! Thank you for pointing that out.September 16, 2014 at 12:29 pm #2464IchoMusic
ParticipantHi 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 11 years, 8 months ago by
IchoMusic.
September 16, 2014 at 12:34 pm #2469IchoMusic
ParticipantUpdate – 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 11 years, 8 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.