0

Contact Form 7 Select Box Blank Value with custom option text

Use the following code in your function.php to change the “include_blank” with custom option text [code langauage=”php”] function my_wpcf7_form_elements($html) { $text = ‘Please select…’; $html = str_replace(‘<option value="">—</option>’, ‘<option value="">’ . $text . ‘</option>’, $html); return $html; } add_filter(‘wpcf7_form_elements’, ‘my_wpcf7_form_elements’);… Continue Reading

0

Remove Woocommerce default address fields

Use the following action hook to remove default address fields value from checkout page [code language=”css”] <pre><code>add_filter(‘woocommerce_default_address_fields’, override_address_fields’); function override_address_fields( $address_fields ) { $address_fields[‘address_1’][‘placeholder’] = ”; $address_fields[‘address_2’][‘placeholder’] = ”; $address_fields[‘city’][‘placeholder’] = ”; $address_fields[‘state’][‘placeholder’] = ”; $address_fields[‘postcode’][‘placeholder’] = ”; return $address_fields;… Continue Reading

0

Save Gravity Forms Data to a Custom Database Table

[code language=”php”] add_action(‘gform_after_submission’, ‘endo_add_entry_to_db’, 10, 2); function endo_add_entry_to_db($entry, $form) { // uncomment to see the entry object // echo ‘<pre>’; // var_dump($entry); // echo ‘</pre>’; $source = $entry[‘source_url’]; $email = $entry[5]; $param1 = $entry[2]; $param2 = $entry[3]; global $wpdb; //… Continue Reading

0

Add Custom Fields To Custom Taxonomies in WordPress

Add the custom fields on your custom taxonomies show the the custom field on the add screen and on edit screen add the following code in function.php [code language=”php”] // A callback function to add a custom field to our… Continue Reading

0

How to Make Featured Post in WordPress

To Make the featured post we are adding a checkbox as a custom field add the following code to add the checkbox as a custom field [code language=”php”] function register_post_assets(){ add_meta_box(‘featured-post’, __(‘Featured Post’), ‘add_featured_meta_box’, ‘post’, ‘advanced’, ‘high’); } add_action(‘admin_init’, ‘register_post_assets’,… Continue Reading