Reorder the Speaker Detail Fields

/** * Reorder the speaker detail fields. * * The default order is: title, website, email, phone, social_links. * This snippet changes it to: title, phone, email, website, social_links. * * Hook: sc_speaker_details_data_order (filter) * File: sugar-calendar/src/Pro/Features/Speakers/Frontend/Singular.php:164 * Since: Sugar…Continue reading

Optimize Search Results

// 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

Plain Upcoming Events List Shortcode

/** * 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

Backend Retailer URL Injector

/** * 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

Dynamic External Retailer Button Injector

/** * 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

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