Create dynamic / data driven pages in wordpress

There are potentially many ways to achieve what you want to do. My approach would be to use WooCommerce and then define ‘Ford Focus’ as a product. I then would configure the product to offer the various different colors and/or any other features. This approach would not create 5 pages on the sitemap. It would … Read more

Install/Enable/Activate plugin on multisite without access to master site

There’s an option in the wp_sitemeta table with meta_key ‘menu_items’ this value is referred to the checkbox “Administration menu” of the page /wp-admin/network/settings.php (accessible only to siteadmins) that allows the activation of plugins on single sites. I’ve not tested but using the value a:1:{s:7:”plugins”;s:1:”1″;} and having the plugin uploaded via ftp you should see the … Read more

Display information from metabox

I managed to find the soulution: add_action(‘woocommerce_after_add_to_cart_button’, ‘wc_min_quantity’,10,2); function wc_min_quantity($product) { if(function_exists(‘icl_object_id’)) { $default_language = wpml_get_default_language(); $prodid = icl_object_id($product->get_id(), ‘product’, true, $default_language); } else { $prodid = $product->id; } $prodid = get_the_ID(); $minQty = get_post_meta($prodid, ‘_wc_mmax_min’, true); if ($minQty > 0) { } echo “Minimum order quantity: $minQty”; }

Run a Change Role Cron Job on WordPress via cPanel

Managed to find the solution. My finished code is: register_activation_hook ( __FILE__, ‘cron_job’ ); function cron_job() { wp_schedule_event( time(), ‘hourly’, ‘hourly_job’ ); } add_action( ‘hourly_job’, ‘cron_job_task’ ); function cron_job_task () { $users = get_users( array( ‘fields’ => array( ‘ID’, ‘user_registered’ ), ‘role’ => ‘coaching’, ) ); foreach ( $users as $user ) { $time = … Read more

Is it possible to create duplicate post on other site (either push, on publish, or pull, periodically)?

You could add a filter to the post publish process in site A. The filter would check for the tag/category, and if found, run a process to create a post in Site B. See https://codex.wordpress.org/Plugin_API/Action_Reference/save_post . Something like: add_action( ‘save_post’, ‘my_site_b_create_post’ ); function my_site_b_create_post($post_id) { // check for category // if category, then save content … Read more