// 1. Exclude pages from search results function exclude_pages_from_search($query) { if (!is_admin() && $query->is_search && $query->is_main_query()) { $query->set(‘post_type’, ‘post’); } return $query; } add_action(‘pre_get_posts’, ‘exclude_pages_from_search’); // 2. Search only titles and excerpts (exclude post content) function search_title_excerpt_only($search, $wp_query) { global…Continue reading
/** * Bare, theme-friendly list of upcoming events. * * The Events List block bakes in an title and calendar icons and is hard * to restyle. This snippet adds a shortcode that outputs a plain, one-line-per * event list…Continue reading
/** * Allow tag slugs in the sugarcalendar_events_list shortcode. * * Sugar Calendar’s shortcode only accepts term IDs in the `tags` attribute. * This filter intercepts the raw shortcode attributes before the sanitized * (now-empty) value is used, resolves any…Continue reading
add_action( ‘wp_enqueue_scripts’, function() { if ( ! class_exists( ‘FrmRegGlobalSettings’ ) || ! class_exists( ‘FrmProAppController’ ) ) { return; } $global_settings = new FrmRegGlobalSettings(); $reset_page_id = (int) $global_settings->get_global_page( ‘resetpass_page’ ); if ( ! $reset_page_id || ! is_page( $reset_page_id ) ) {…Continue reading
/** * LexiPress: Backend Retailer URL Injector * Creates dedicated input fields in the WooCommerce Product Data panel. */ if ( ! defined( ‘ABSPATH’ ) ) { exit; } // 1. Inject the fields into the “General” tab of the…Continue reading
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
remove_action( ‘wp_footer’, ‘wpcomsh_footer_rum_js’ ); // remove frontend // remove_action( ‘admin_footer’, ‘wpcomsh_footer_rum_js’ ); // remove backendContinue reading
/** * LexiPress: Dynamic External Retailer Button Injector * Updated: Hooked to load below the description tabs. */ if ( ! defined( ‘ABSPATH’ ) ) { exit; } // Changed hook and priority to place it below the tabs add_action(…Continue reading
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