Cronjob function not executed – negative seconds

I’ve managed to fix it! The problem was calling the wrong add_action. I had: // Schedule Cron Job Event function custom_cron_job() { if ( ! wp_next_scheduled( ‘XML_import’ ) ) { wp_schedule_event( time(), ‘hourly’, ‘XML_import’ ); } } add_action( ‘wp’, ‘custom_cron_job’ ); But it must be: // Schedule Cron Job Event if (! wp_next_scheduled( ‘xml’ ) … Read more

how to restore a wordpress website, when hosting has got expired but the hosting company gives you a bunches of zip file?

On your new hosting place, create a new/empty WP install. That will create a database. Remember the credentials. Then create a new database, and import the data you got from the old host. Remember the credentials; assign the user/pass to that database. Then go into the new install, inside the wp-config.php file, and change the … Read more

Show total sales for each products on search results page Woocommerce

You can use third-party WooCommerce plugin ‘Woo Total Sales’ to display total sales of the specific product on product archive, product single or product search page. Woo Total Sales: https://wordpress.org/plugins/woo-total-sales/ You can also use below shortcode that plugin provides and add product ID to display its count. [awts-total-sales product_id=”0″ include_setting=”true/false”]

Rewrite Page Parameters

If city belongs to the page post type, then your rule should either be: add_rewrite_rule( ‘^city/([^/]*)/?’, ‘index.php?pagename=city&id=$matches[1]’, ‘top’ ); or: add_rewrite_rule( ‘^city/([^/]*)/?’, ‘index.php?page_id=5&id=$matches[1]’, ‘top’ ); Using p, the query will assume post type is post, not page. Also, if your code uses $_GET[‘id’] to fetch the value, this will no longer work with a rewrite … Read more