Place Search Field within PHP block

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 IchoMusic 9 years, 6 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2453
    IchoMusic
    IchoMusic
    Participant

    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
    Nick

    #2454
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    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 :)


    #2455
    IchoMusic
    IchoMusic
    Participant

    No 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.
    #2457
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Okay, 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 :)


    #2458
    IchoMusic
    IchoMusic
    Participant

    Hi,

    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.
    #2461
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    The 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 :)


    #2462
    IchoMusic
    IchoMusic
    Participant

    Hi,

    Sorry … I must have copied the wrong bit of code from the documentation.

    All working now … thank you!

    #2463
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    No problem at all.
    Indeed it’s incorrect in the documentation! Thank you for pointing that out.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #2464
    IchoMusic
    IchoMusic
    Participant

    Hi 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, 6 months ago by IchoMusic IchoMusic.
    Attachments:
    You must be logged in to view attached files.
    #2469
    IchoMusic
    IchoMusic
    Participant

    Update – I just tried this setting .. attached .. and it seems to have removed the icon … not sure why but it’s worked.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.