How to get this .php code from my theme into my plugin?

You don’t, what you’ve modified is a template file, those don’t go in plugins. Instead, create a child theme and copy this file into that theme. WordPress will preferentially load templates from the child theme, falling back to the original parent theme. This way any modifications you make in the child theme will overwrite the … Read more

ajax contact form not submit message

About sending emails: wp_mail by default utilizes default PHP’s mailing setting, and PHP by default uses sendmail service so if you don’t have one functioning on localhost you’ll not be able to sendemails, you can use something like MailHog – to capture send emails for you on localhost and you’ll actually will be able to … Read more

wordpress notice

I’d guess the problem is the end(), which accepts an array reference. Try saving the explode() result in a variable and passing that to end(): $path_components = @explode( get_template(), str_replace( ‘\\’, “https://wordpress.stackexchange.com/”, dirname( __FILE__ ) ) ); $path = ltrim( end( $path_components ), “https://wordpress.stackexchange.com/” ); define( ‘OT_LANG_DIR’, trailingslashit( trailingslashit( get_template_directory() ) . $path ) . … Read more

Adding column to wpex_users

You should never modify the WP core tables, all your changes will be undone and the data lost the next time WP updates its table schema. Instead, if you want to store more data on a user, do what other people do and use user meta: update_user_meta get_user_meta add_user_meta delete_user_meta You can even query for … Read more