Add file upload with validation to custom form

<?php /* Template Name: Contact-Page-with-upload * * A Custom PHP Contact us page. Add or change form fields on line 28 and in the form itself. * Jquery is used to add/remove Bootstrap has-error class to invalid fields. */ /** * Get Error Class * * @return string; */ $response=””; function getErrorClass($failedKeys, $key) { if(isset($failedKeys) … Read more

How to submit form data in the same page in WordPress without reloading the page?

Your jQuery event is bound to elements with the class submit, but your submit button in the form doesn’t have that class. Either add that class to the submit button, or just target the form itself. Simply change $(“.button”).click(function() { to $(“#modalForm”).submit(function() { This will fire when the form is submitted, whether the user clicks … Read more

Creating wordpress user registration form

You are sending the data from the form directly to TestForm.php file, which is a PHP script outside of WordPress logic. It is and independent script. You could set the form’s action attribute to a empty string, this way the form data is sent to same page that contains the form, which is part of … Read more

How add custom text under comment form

You can modify the comment form. WordPress provides various hooks. See comment_form(). Actions comment_form_comments_closed comment_form_before comment_form_must_log_in_after comment_form_top comment_form_logged_in_after comment_form_before_fields comment_form_after_fields comment_form comment_form_after Filters comment_form_default_fields the_permalink comment_form_defaults comment_form_logged_in comment_form_fields comment_form_field_comment comment_form_field_{$name} comment_form_submit_button comment_form_submit_field

Secretly passing post ID/title etc into a shortcode form automatically to link submission to post

If you put a unique placeholder value there, you can do a find/replace via the_content filter, which runs after the shortcode is rendered, but before the content is output in the template. For example, this will replace any occurrence of replacethisthing with the post ID: function wpd_replace_something_in_the_content( $content ){ return str_replace( “replacethisthing”, get_the_ID(), $content ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)