aslgraham
Forum Replies Created
-
Hi Hitesh,
Thank you again for your help.
Totally understand. I think I can use the “Insert PHP Code Snippet” plugin to do that. Do you know of another way without using a plugin?
Many thanks 🙂
Hi Hitesh,
Thanks so much for getting back to me. The support is brilliant.
I’m afraid the results are the same dev.mcfederation.com?
I’m using Elementor pro ‘HTML code’ widget to add the form below.
<form method=”GET” action=”/mcf-events”>
<p>
<label for=”keywords”>Keywords</label>
<input type=”text” id=”search_keywords” name=”search_keywords” />
</p>
<p>
<label for=”keywords”>Location</label>
<input type=”text” id=”search_location” name=”search_location” />
</p>
<p>
<label for=”search_category”>Category</label>
<select id=”search_category” name=”search_category”>
<!–?php foreach ( get_event_listing_categories() as $cat ) : ?–>
<option value=”<?php echo esc_attr( $cat->term_id ); ?>”><!–?php echo esc_html( $cat–>name ); ?></option>
<!–?php endforeach; ?–>
</select>
</p>
<p>
<input type=”submit” value=”Search” />
</p>
</form>I found a syntax error is (line 3) – ( $cat—>name ) should be ‘( $cat–>name )’. Anyway, that’s not the problem 🙁
<select id=”search_category” name=”search_category”>
<!–?php foreach ( get_event_listing_categories() as $cat ) : ?–>
<option value=”<?php echo esc_attr( $cat->term_id ); ?>”><!–?php echo esc_html( $cat—>name ); ?></option>
<!–?php endforeach; ?–>
</select>It’s a shame because the rest of the form works. I could just remove the Category dropdown and only search by Keywords and Location, but I don’t want to give up just yet. Any thoughts?
Please help.
Hi Priya,
I have already created 14 categories (please see dev.mcfederation.com/mcf-events/. The form is working perfectly. All the categories are in the dropdown.
It’s the Custom Event Search Form I have added to our dev.mcfederation.com I’m having problems with. Is it something to do with get_event_listing_categories, See below the code I’m using: please help.
<form method=”GET” action=”https://dev.mcfederation.com/mcf-events/”>
<h3 class=“search-events”>Search Events</h3>
<p>
<label for=”keywords”>Keywords</label>
<input type=”text” id=”search_keywords” name=”search_keywords” />
</p>
<p>
<label for=”keywords”>Location</label>
<input type=”text” id=”search_location” name=”search_location” />
</p>
<p>
<label for=”search_category”>Category</label>
<select id=”search_category” name=”search_category”>
<?php foreach ( get_event_listing_categories() as $cat ) : ?>
<option value=”<?php echo esc_attr( $cat->term_id ); ?>”><?php echo esc_html( $cat->name ); ?></option>
<?php endforeach; ?>
</select>
</p>
<p>
<input id=”submit-btn” type=”submit” value=”Search” />
</p>
</form>Hope to hear from you soon.
- This reply was modified 5 years, 11 months ago by aslgraham.
Hi Priya,
Works like a dream!
Thank you for all your help and patience.
All the best 🙂
Hi Priya,
I have added the field as your instructions. The Watch Video field is now visible on the post an event form.
However, how do you get it to display in the youtube modal popup? When you say “with necessary details” what are they? I tried a text and file fields but neither worked.
When the user clicks the Watch video button, I want the video to be viewed in the youtube modal popup. The same as this link.
Please help,
Hope to hear from you soon.
Many thanks.