How to add subdomain to htaccess

In your plugin: <?php register_activation_hook(WP_PLUGIN_DIR.’/your/plugin/path/plugin.php’, ‘wpse_set_subdomain’); function wpse_set_subdomain() { $siteurl = site_url(); $subdomain = substr($siteurl, 8, 3); // may need to adjust which substring to grab update_option(‘wpse_subdomain’, $subdomain); } ?> Then wherever you have conditional content: <?php $subdomain = get_option(‘wpse_subdomain’); if($subdomain == ‘www’) { // www code } else { // other code } ?> … Read more

Help with customising love it plugin (use within foreach)

A couple of problems- setup_postdata doesn’t work with any variable other than $post, so that line is doing nothing. This is explained on the Codex page for setup_postdata. get_the_ID doesn’t accept any arguments, but it doesn’t matter, you’ve already got the ID in $event->ID, just change all instances of get_the_ID($event->ID) to $event->ID.

Can I upload wordpress plugin made with framework

Welcome to wordpress.stackexchange.com. I don’t think plugins with frameworks are allowed, sorry. https://wptavern.com/the-wordpress-plugin-directory-will-no-longer-accept-frameworks https://make.wordpress.org/plugins/2016/03/01/please-do-not-submit-frameworks/ Here are Detailed Plugin Guidelines https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/ And here about Writing a Plugin https://codex.wordpress.org/Writing_a_Plugin If this answer helped you or solved your issue please vote and/or mark it accepted, thank you.

Change value of Points earned in product data

Add following code to your functions.php file in theme directory. add_action(‘init’, ‘set_point_earned’); function set_point_earned() { global $wpdb; $wpdb->query(“INSERT INTO {$wpdb->postmeta} (post_id, meta_key, meta_value) SELECT ID, ‘_ywpar_point_earned’, ‘5’ FROM {$wpdb->posts} WHERE post_type IN (‘product’,’product_variation’) AND NOT EXISTS ( SELECT * FROM {$wpdb->postmeta} WHERE post_id = ID AND meta_key = ‘_ywpar_point_earned’ )”); } Then visit your site. … Read more