image dimension in php code args

I used this code, but nothing happen, maybe there is something small detail missing thankyou who ever may help $mimes = array( ‘image/jpeg’); if( !in_array( $file[‘type’], $mimes ) ) return $file; $image = getimagesize($file[‘tmp_name’]); $minimum = array( ‘width’ => ‘400’, ‘height’ => ‘400’ ); $maximum = array( ‘width’ => ‘400’, ‘height’ => ‘400’ ); $image_width … Read more

Custom Registration and Login Forms with reCaptcha 2 Validation

First connect the CAPTCHA script (add to: functions.php) function onwp_enqueue_frontend() { wp_enqueue_script(‘ha-recaptcha’, ‘https://www.google.com/recaptcha/api.js’, array(‘jquery’), ‘1.0’, true); } add_action(‘wp_enqueue_scripts’, ‘onwp_enqueue_frontend’); In the form of adding the following html code to display the captcha <div class=”g-recaptcha” data-sitekey=”YOU_SITE_CODE”></div> YOU_SITE_CODE – replaced by your code Next, add the CAPTCHA validation feature $recaptcha = $_POST[‘data’][‘g_recaptcha_response’]; if (!empty($recaptcha)) { $google_url = … Read more

Simple Probléme in wordpress

You’ll have to give a little more explanation. But I think that the problem is that you are using get_template_directory_uri() as an anchor link. What get_template_directory_uri() does is to give you the URL of your theme, for instance you can get your “/assets/images” folder like this. If your site structure is “theme_folder/page1.php” then I recommend … Read more

Problem with function.php.. like

That’s a backdoor code injected probably caused by a nulled theme or plugin in your site. I’m having the same issue. The solution is to scan the whole site and get rid of everything you haven’t paid for.

WooCommerce Orders pagination

OK. As far as I researched the WooCommerce provides default pagination for orders in My Account page. See this GitHub issue here. And also see, there is a hook declared at my-orders.php in your code called woocommerce_before_account_orders_pagination by doing <?php do_action( ‘woocommerce_before_account_orders_pagination’ ); ?> So WooCommerce provides default pagination. You better use it. May be … Read more

WP_Query not returning results

if you print_r($houseQuery), what is your request query? It’s a correct SQL query? When you print WP_Query object you can find this in structure: [request] => SELECT SQL_CALC_FOUND_ROWS[…] You need to analyze this to understand what’s going on. Let me know.

wp_query on search results page showing all results every time

Don’t create a new WP_Query. As per the template hierarchy WordPress uses the search.php template in your theme for the search results page. This template just needs to contain The Loop, and the only posts inside that will be your search results. See Twenty Seventeen’s search results template as an example: https://github.com/WordPress/twentyseventeen/blob/master/search.php

Exclude specific product tags from related products in WooCommerce 3+ [closed]

The first parameter of the filter gets its value from function wc_get_product_term_ids: http://hookr.io/filters/woocommerce_get_related_product_tag_terms/ This function returns an array of term_ids instead of objects: https://docs.woocommerce.com/wc-apidocs/source-function-wc_get_product_term_ids.html#860-871 So you can match the term id values directly or you can use get_term_by to get one of the term objects in the comparison. e.g. getting the term on the right … Read more