How to create custome pdf file of my invioice in wordpress

Assuming you’re creating this as a plugin and you’ve saved the dompdf directory within your plugin directory you can include it with the following. // wp-content/plugins/yourplugin/yourplugin.php // Set up paths to include DOMPDF $plugin_path = plugin_dir_path( __FILE__ ); define( ‘YOURPLUGIN_DOMPDF’, $plugin_path . ‘dompdf/’ ); // Set up directory to save PDF $upload_dir = wp_upload_dir(); define( … Read more

using ajax to query sql

See documentation WordPress have admin-ajax.php file in wp-includes/ folder. Put in your data parametr action and create hooks: add_action(‘wp_ajax_{your_action}’, ‘handler’); add_action(‘wp_ajax_nopriv_{your_action}’, ‘handler’); ajax.url parametr you can get by using wp_localize_script(‘YOUR SCRIPT handle’, ‘ajax’, array(‘url’=> admin_url(‘admin-ajax.php’))) All code must looks like: add_action( ‘wp_enqueue_scripts’, ‘callback_for_setting_up_scripts’ ); function callback_for_setting_up_scripts() { wp_register_style( ‘mein-plugin’, plugins_url( ‘style.css’, __FILE__ ) ); wp_enqueue_style( … Read more

How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?

WordPress uses wp_enqueue_script() to register and enqueue javascript contained in a separate file. The default behavior is for wp_enqueue_script() is to load the script before the </body> tag, and apparently WordPress pages require the script to be loaded in the footer. As pointed out in the comments, the clue to this problem with the loading … Read more