Does the WordPress API have Modal Dialogs

Yes, WordPress has modal dialog and it is called as Thickbox, but I am not sure how flexible it is to implement what you want to. Here is the code – <?php add_thickbox(); ?> <div id=”my-content-id” style=”display:none;”> <p> This is my hidden content! It will appear in ThickBox when the link is clicked. </p> </div> … Read more

Customize the Sorting Dropdown in WooCommerce

Actually, with a little digging this is quite easy to do. WooCommerce has already set up a filter so all you have to do it add a small snippet in your functions.php file. // Modify the default WooCommerce orderby dropdown // // Options: menu_order, popularity, rating, date, price, price-desc function my_woocommerce_catalog_orderby( $orderby ) { unset($orderby[“price”]); … Read more

Add extra parameter in tag using script_loader_tag

You can use script_loader_tag filter to fulfill your requirement. add below code in your active theme’s functions.php file. it will add extra parameter in your script tag. function add_attribute_to_script_tag($tag, $handle) { # add script handles to the array below $scripts_to_defer = array(‘wpfrank-ptbw-pinit-js’); foreach($scripts_to_defer as $defer_script) { if ($defer_script === $handle) { return str_replace(‘ src’, ‘ … Read more

How to prevent spam comments?

+1 for akismet http://wordpress.org/extend/plugins/cookies-for-comments/ Is also amazing. Akismet is great at catching spam, but adding cookies for comments is awesome. It stops a lot of the auto-posted spam. (Which most of it is) Cookies for comments will stop the comment before it even gets to you. Akismet was catching 50 spams a day for me. … Read more

WooCommerce – filter by featured products in admin

You can sort your products list by the featured status. Just click on the star at the top of the column…. once will put all non-featured items at the top, and twice should reverse this and put all featured items at the top. Your admin url will look like: /wp-admin/edit.php?post_type=product&orderby=featured&order=desc EDIT: Ok, so it turned … Read more

How to disable autocomplete for inputs in contact form 7? [closed]

Autocomplete tag in form settings does not work anymore (as today Contact Form 7 plugin version 5.1.3. The only solution which worked for me was to add custom attributes thanks to https://stackoverflow.com/a/46316728/1720476. E.g. if You have FirstName and LastName fields, where You want to disable autocomplete. Add this into functions.php file: add_filter( ‘wpcf7_form_elements’, ‘imp_wpcf7_form_elements’ ); … Read more

PDF download – use wordpress functions

You should create a function in your plugin where you listen to a specific URL or watch for specific parameters. For example to generate the download link: <?php $nonce = wp_create_nonce( ‘download-‘ . $filename ); echo ‘<a href=”https://wordpress.stackexchange.com/?_wp_nonce=”‘ . $nonce . ‘&download=’ . $filename . ‘”>Some Download</a>’; ?> And to download the file: if ( … Read more