how to add a custom form in a page

A basic example of inserting data into post meta fields. In your chosen template file you can do something similar to, <?php //this does not include data validation and sensitization but will check for the //existence of $_POST values being set. if ( ‘POST’ == $_SERVER[‘REQUEST_METHOD’] && !empty( $_POST[‘action’] ) && $_POST[‘action’] == “add_meta”) { … Read more

Form action URL unrecognized

I would like to recommend you to read The Rewrite API: The Basics article. Especially pay attention to the Add Custom Endpoint section where you can find how to create what you need.

Where to add css file that I want my forms to use?

Use wp_enqueue_style to add additional stylesheets to a theme. Additionally, you can use it with a Child Theme to preserve your edits in case the original theme is updated. function wpa_form_style() { wp_enqueue_style( ‘my-form-styles’, get_stylesheet_directory_uri() . ‘/my-form-styles.css’ ); } add_action( ‘wp_enqueue_scripts’, ‘wpa_form_style’ ); or if you only need your styles for a specific page, conditionally … Read more

Should I use wp_nonce_field on my contact form?

You should not. Nonce is used to protect against cross site request forgery attacks (CSRF) in which another aite tries to trick you into submitting a form to your site which will perform some hostile action. Nonces are unique value that can be generated only by a specific site at a specific time and therefor … Read more

WordPress tabindex Order

The “Skip to toolbar” in the WP Navbar comes tabindex attribute set to 1; I really think it is correct because it is the first visual element when the navbar is active. The problem is that the HTML of the navbar isn’t really the first in the source code, it is in the footer, so … Read more

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