Restrict Dashboard Access

function disable_dashboard_access() { $file = basename( $_SERVER[‘PHP_SELF’] ); if ( is_user_logged_in() && is_admin() && ! current_user_can( ‘edit_posts’ ) && $file != ‘admin-ajax.php’ ) { wp_redirect( home_url() ); exit; } } add_action( ‘init’, ‘disable_dashboard_access’ );Continue reading

Dynamic External Retailer Button Injector

/** * LexiPress: Dynamic External Retailer Button Injector * Pulls URLs from WooCommerce Custom Fields and renders a styled button grid. */ if ( ! defined( ‘ABSPATH’ ) ) { exit; } add_action( ‘woocommerce_single_product_summary’, ‘lexipress_render_retailer_buttons’, 30 ); function lexipress_render_retailer_buttons() {…Continue reading

FAQ Accordion – Course Description Template (2)

add_shortcode(‘ptr_faqs’, function () { if (!function_exists(‘get_field’)) return ”; $faqs = get_field(‘faqs’, ‘option’); if (empty($faqs)) return ”; $out = ‘ ‘; foreach ($faqs as $i => $faq) { $q = isset($faq[‘question’]) ? $faq[‘question’] : ”; $a = isset($faq[‘answer’]) ? $faq[‘answer’] :…Continue reading

Enable Excerpt Content for Homepage Three Box Services

add_filter( ‘get_the_excerpt’, function( $excerpt ) { remove_filter( ‘the_content’, array( SiteOrigin_Panels::single(), ‘generate_post_content’ ) ); return $excerpt; } ); add_filter( ‘the_content’, function( $content ) { add_filter( ‘the_content’, array( SiteOrigin_Panels::single(), ‘generate_post_content’ ) ); return $content; }, 11 );Continue reading

Podcast RSS Feed

add_action( ‘wp_enqueue_scripts’, function() { wp_add_inline_script( ‘jquery’, ‘ jQuery(document).on(“click”, “.uvri-tab-btn”, function() { jQuery(“.uvri-tab-btn”).removeClass(“active”); jQuery(“.uvri-tab-panel”).removeClass(“active”); jQuery(this).addClass(“active”); jQuery(“#” + jQuery(this).data(“tab”)).addClass(“active”); }); ‘ ); } ); function uvri_podcast_episodes_shortcode() { $year_season = array( 2023 => 1, 2024 => 2, 2025 => 3, 2026 => 4,…Continue reading