[wpb-random-posts]
$args = array( ‘post_type’ => ‘post’, ‘orderby’ => ‘rand’, ‘posts_per_page’ => 5, );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
$args = array( ‘post_type’ => ‘post’, ‘orderby’ => ‘rand’, ‘posts_per_page’ => 5, );Continue reading
function open_internal_links_in_new_tab() { echo ‘ ‘; } add_action(‘wp_footer’, ‘open_internal_links_in_new_tab’);Continue reading
// This will replace “[year]” with the current year automatically. $this_year = “[year]”; echo str_replace(“[year]”, date( ‘Y’ ), $this_year);Continue reading
function mepr_remove_state_field() { global $post; $mepr_options = MeprOptions::fetch(); $is_product_page = ( false !== ( $prd = MeprProduct::is_product_page( $post ) ) ); if( $mepr_options->global_styles || $is_product_page ) { ?>Continue reading
function mepr_change_membership_urls( $url, $product, $args, $modify_if_https ) { $url_changed = false; switch( $product->ID ) { case ‘123’: //Change 123 to membership id where you can get it from ID column from Membership table $url = MeprUtils::get_permalink( 456 ).$args; //Change 456…Continue reading
function mepr_change_state_dropdown_values ( $states ) { $sfiles = @glob( WP_PLUGIN_DIR . ‘/mepr-i18n/states/[A-Z][A-Z].php’, GLOB_NOSORT ); foreach( $sfiles as $sfile ) { require( $sfile ); } return $states; } add_filter( ‘mepr_states’, ‘mepr_change_state_dropdown_values’ );Continue reading
function mepr_auto_populate_coupon() { ?>Continue reading
function auto_click_have_coupon_link() { ?>Continue reading
// See [Using only ID in product url in WooCommerce?](https://stackoverflow.com/a/70457452) add_action(‘save_post_product’, ‘incontrol_set_product_title’, 10, 3); function incontrol_set_product_title ($post_id){ // This temporarily removes action to prevent infinite loops remove_action(‘save_post_product’, ‘incontrol_set_product_title’); // Update title wp_update_post(array( ‘ID’ => $post_id, ‘post_name’ => $post_id // WordPress…Continue reading