How to add a placeholder to the protected post password input

This can be achieved via a hook, called the_password_form: function my_theme_password_placeholder($output) { $placeholder=”Hello!”; $search=”type=”password””; return str_replace($search, $search . ” placeholder=\”$placeholder\””, $output); } add_filter(‘the_password_form’, ‘my_theme_password_placeholder’); A str_replace searches for the string type=”password” inside the output. This gives an attribute to the <input> indicating it’s of type password. The replacement string contains the searched one plus the … Read more

How can ι create my own (custom) WordPress table/list?

I’m not an expert on this but I did get into it a little recently. Take a look at this tutorial: http://wpengineer.com/2426/wp_list_table-a-step-by-step-guide/ Basically, you’ll want to create a class that extends WP_List_Table: class My_List_Table extends WP_List_Table { // what your table is all about } $myListTable = new My__List_Table(); It is an involved process, but … Read more

How to move HTML form to WP Theme

use wp_enqueue_script() function to load your required javascript and css files for the form. Then follow this tutorial to have knowledge about creating a form plugin and how to use that. You have another option left. If you are familiar with WordPress page template then you can create a page template for the page that … Read more

WordPress Emails & Contact Forms [closed]

Your could debug php mailer in WP using franz’s wpmail_exceptions plugin https://gist.github.com/franz-josef-kaiser/5840282 Place the first file in /wp-content/mu-plugins/ and make sure you’ve set WP_DEBUG to true. You should test while logged in as administrator. Errors will be printed in main buffer so make sure to inspect any xhr requests if your form works asynchronously (Ajax). … Read more

Custom tables and using wpdb to insert into DB from a html form

You’re using a placeholder (“%s”) in your SQL for prepare, but you don’t pass it a value to put in place of that placeholder, hence the complaint. use $wpdb->prepare(“SELECT … %s”, $myvalue) And I’m pretty sure your other error stems from you passing in a DateTime object. $wpdb will not convert that automatically, it expects … Read more

HTML Form Submit to table in same page

Couple of things with this. Your action attribute is empty. That’s the attribute that tells the browser where to send the posted form data. Should be a field or if you’re using AJAX, I always put # in there and let the javascript do it’s thing. Not sure about the cf_name attribute in your input … Read more