// Add custom scripts function add_custom_script_bootstrap5() { wp_register_script( ‘bootstrap5_js’, ‘https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.min.js’, array(), ‘5.3.3’, true ); wp_enqueue_script( ‘bootstrap5_js’ ); wp_register_style( ‘bootstrap5_css’, ‘https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/css/bootstrap.min.css’, array(), ‘5.3.3’, true ); wp_enqueue_style( ‘bootstrap5_css’ ); wp_register_style( ‘bootstrap5_css_containers’, ‘https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/scss/_containers.scss’, array(), ‘5.3.3’, true ); wp_enqueue_style( ‘bootstrap5_css_containers’ ); } add_action( ‘wp_enqueue_scripts’,…Continue reading
// Add custom scripts function add_custom_script_webfont_loader_js() { wp_register_script( ‘webfontloader’, ‘https://cdnjs.cloudflare.com/ajax/libs/webfont/1.6.28/webfontloader.js’, array(), ‘1.6.28’, true ); wp_enqueue_script( ‘webfontloader’ ); } add_action( ‘wp_enqueue_scripts’, ‘add_custom_script_webfont_loader_js’ );Continue reading
// Detect if web fonts are available function add_custom_script_font_face_observer_js() { wp_register_script( ‘fontface_observer’, ‘https://cdnjs.cloudflare.com/ajax/libs/fontfaceobserver/2.3.0/fontfaceobserver.standalone.js’, array(), ‘2.3.0’, true ); wp_enqueue_script( ‘fontface_observer’ ); } add_action( ‘wp_enqueue_scripts’, ‘add_custom_script_font_face_observer_js’ );Continue reading
// Add custom scripts function add_custom_script_masonry_js() { wp_register_script( ‘masonry’, ‘https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js’, array(), ‘4’, true ); wp_enqueue_script( ‘masonry’ ); } add_action( ‘wp_enqueue_scripts’, ‘add_custom_script_masonry_js’ );Continue reading
// Add custom scripts function add_custom_script_fullpage_js() { wp_register_script( ‘fullpage’, ‘https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/4.0.29/fullpage.min.js’, array(), ‘4.0.29’, false ); wp_enqueue_script( ‘fullpage’ ); } add_action( ‘wp_enqueue_scripts’, ‘add_custom_script_fullpage_js’ );Continue reading
h4.gold { border-left-color: gold; border-left-style: solid; border-left-width: 4px; padding-left: 10px; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: lightsteelblue; } h3.gold { border-bottom-color: gold; border-bottom-style: solid; border-bottom-width: 3px; } h2.gold { background-color: gold; padding-left: 10px; } h3.brown { text-decoration-line: underline; text-decoration-color: goldenrod; text-decoration-style:…Continue reading
function wpcode_snippet_add_slug_body_class( $classes ) { global $post; if ( isset( $post ) ) { $classes[] = $post->post_type . ‘-‘ . $post->post_name; } return $classes; } add_filter( ‘body_class’, ‘wpcode_snippet_add_slug_body_class’ );Continue reading
function maybe_hide_pause_resume_links( $link, $sub ) { // Replace 123, 456 with the membership IDs which members can pause/resume subscriptions for. $products_to_allow = array( ‘123’, ‘456’ ); $product = $sub->product(); if( in_array( $product->ID, $products_to_allow ) ) { return $link; } else…Continue reading
function mepr_capture_stopped_sub( $event ) { global $wpdb; $subscription = $event->get_data(); $wpdb->update( $wpdb->prefix.’mepr_transactions’, array( “expires_at” => “2024-01-01 23:59:59” ), array( “subscription_id” => $subscription->id, “status” => “complete” ) ); } add_action( ‘mepr-event-subscription-stopped’, ‘mepr_capture_stopped_sub’ );Continue reading
function memberpress_account_subs_display( $atts, $content=” ) { if( !class_exists( ‘MeprAccountCtrl’ ) ) { return; } ob_start(); $acct_ctrl = new MeprAccountCtrl(); $action = ( isset($_REQUEST[ ‘action’ ] ) )?$_REQUEST[ ‘action’ ]:false; switch( $action ) { case ‘cancel’: $acct_ctrl->cancel(); break; case ‘suspend’: $acct_ctrl->suspend();…Continue reading