Jump to content

Recommended Posts

Hi - I'm using the WP Job Boards plugin for Wordpress.  I've been given this code to create a quick search form to place in a widget.  I've tried to paste the code in a sidebar widget and apparently after somebody inputs the keyword and location they should be sent to the results page which will show their results, however, it's not doing that, just showing me a 'page cannot be found' result.

 

Can anybody help me out with correcting the code?

 

<form action="<?php esc_attr_e(wpjb_link_to("http://www.littlefoxwebdesign.co.uk/etsgroup/jobs")) ?>" method="GET">
Keyword: <input type="text" name="query" value="" /><br/>
Location: <input type="text" name="location" value="" /></br/>
<input type="submit" value="Search" />
</form>
 
Thank you!
 
Link to comment
https://forums.phpfreaks.com/topic/289000-php-code-in-wordpress/
Share on other sites

Is the widget you are using capable of parsing php code?

You can try something like this and the code below

https://wordpress.org/plugins/php-text-widget/

<form action="<?php esc_attr_e(wpjb_link_to("http://www.littlefoxwebdesign.co.uk/etsgroup/jobs"));?>" method="GET">
Keyword: <input type="text" name="query" value="" /><br/>
Location: <input type="text" name="location" value="" /></br/>
<input type="submit" value="Search" />
</form>
Edited by QuickOldCar

When viewing the page in your browser, have you looked at the source code for the page? Does it look like the value for action attribute was interpreted correctly?

It shows as

<div class="textwidget"><form action="<?php esc_attr_e(wpjb_link_to("search")) ?>" method="GET">

so not parsing the php

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.