wordpress – make custom field values clickable to retrive them later
wordpress – make custom field values clickable to retrive them later
wordpress – make custom field values clickable to retrive them later
Having spent about a day figuring out how to do this, I thought it might be helpful to others in the stackoverflow community. GOAL: To take the results from a form field and use it on another page. In this example, my client wanted users to be able to fill in any amount in a … Read more
In case someone still needs it – instructions on how to add new columns in Woocommerce orders list. No need in unsetting the default columns, just add this in your functions.php and your code will be valid for updates. 1. Define columns position and names add_filter( ‘manage_edit-shop_order_columns’, ‘MY_COLUMNS_FUNCTION’ ); function MY_COLUMNS_FUNCTION($columns){ $new_columns = (is_array($columns)) ? … Read more
It is easy to fix. You must change the following tag: <script type=”text/javascript”></script> add: data-cfasync=”false” example: <script data-cfasync=”false” type=”text/javascript”></script>
Straight after the $wpdb->insert() that does the insert, do this: $lastid = $wpdb->insert_id; More information about how to do things the WordPress way can be found in the WordPress codex. The details above were found here on the wpdb class page
This is the code I came up with thanks to some help from a WordPress StackOverflow answer that I can’t find anymore (please comment with a link if you find it). First you need to add the filter to the specific menu (you could add it to all menus if you want – just use … Read more
There are 3 ways that I would suggest for pagination with a custom post wp_query. Unfortunately to this day there isn’t a lot of good information about this out there, or at least what is out there is unclear in some cases. Hopefully this helps! Note, you also did have the wp_reset_postdata() in the wrong … Read more
You can do this with the template_redirect hook. Here’s my code to manually replace the template for a custom post type with one in the theme if there isn’t one in the template folder. Put this in your plugin file and then put a folder underneath your plugin called themefiles with your default theme files. … Read more
There is a wordpress plugin called WC Fields Factory for the exact purpose. You can also achieve this by using the following woocommerce hooks woocommerce_before_add_to_cart_button, woocommerce_add_to_cart, woocommerce_cart_item_name,and ‘woocommerce_add_order_item_meta’ like for adding text field to product page function add_name_on_tshirt_field() { echo ‘<table class=”variations” cellspacing=”0″> <tbody> <tr> <td class=”label”><label for=”color”>Name On T-Shirt</label></td> <td class=”value”> <input type=”text” name=”name-on-tshirt” … Read more
Try to add the code in wp-config.php: define(‘FS_METHOD’, ‘direct’);