How to Add a Custom Size for Thumbnails for WP – Gallery

Use add_image_size(): add_image_size( ‘custom-name’, 123, 456, true ); …will create image size custom-name, with dimensions of 123x456px, hard-cropped. Edit Re this comment: Thanks for comment but honestly I got more confused!can you please let me know what is the ‘custom-name’? How I can associate this name with Gallery thumbnails? The custom-name is arbitrary. It’s whatever … Read more

Update wordpress Core Remotely

You have several options: You can install WP-CLI – http://wp-cli.org/ This will allow you to updates from the command line of your server. Use revision control, Git, Mercurial, etc. That way you just pull in updates to your staging server or localhost and push updates to your sever. Using a build script. You can have … Read more

Error: Call to a member function get_error_code() on a non-object

Your function must return the variable $errors – even when there is no new error in your logic. ‘registration_errors’ is a filter, and filters always expect a return value. Without that your function returns NULL, and that is what var_dump() found. So the basic function body should be: function add_user_to_SF($errors, $sanitized_user_login, $user_email ) { try … Read more

Fatal error: Cannot redeclare admin_notice() [closed]

Ok, solved my own issue… This might be very specific, but in case anyone ever finds a similar issue: to catch unexpected output errors I had another function: add_action(‘activated_plugin’,’save_error’); function save_error(){ $file = “unexpected-output.txt”; $fh = fopen($file, ‘w’) or die(“can’t open file”); $error = ob_get_contents(); fclose($fh); } there was a typo in the fopen(), which … Read more

Plugin AJAX Save to Custom Table

Please use the available API – as you have it in your question I could take down your entire site in a second. (I wrote this tutorial on Data Sanitization and Validation – the last section is particular relevant to you). As for it not inserting the data, you should check WP_DEBUG is turned on, … Read more

change add to cart button link [closed]

After hours of research, i found a somewhat weird solution but somehow works. I used the woocommerce_is_purchasble hook. It passes 2 parameters is_purchasable and object (WC_Product) Which I can now get the product total number of stock. Here’s what I did. function order_is_purchasable($is_purchasable, $object) { if($object->get_total_stock() > 50){ echo ‘<a style=”margin-bottom: 10px;” href=”” class=”button”>Call to … Read more