Custom Search Form

function prefill_category_search( $query ) { if ( ! is_admin() && $query->is_main_query() && $query->is_search ) { if ( ! empty( $_GET[‘category_prefill’] ) ) { $query->set( ‘category_name’, sanitize_title( $_GET[‘category_prefill’] ) ); } } } add_action( ‘pre_get_posts’, ‘prefill_category_search’ );Continue reading

Featured Image Fallback

add_filter( ‘post_thumbnail_html’, ‘my_default_featured_image’, 10, 5 ); function my_default_featured_image( $html, $post_id, $post_thumbnail_id, $size, $attr ) { // If no HTML is generated (no featured image set) if ( empty( $html ) ) { // Replace with your actual image URL $default_image_url…Continue reading

Search Only Tag

function search_only_tag($query) { if (!is_admin() && $query->is_main_query() && $query->is_search) { $query->set(‘tag’, ‘green’); // Replace with tag name } return $query; } add_action(‘pre_get_posts’, ‘search_only_tag’);Continue reading

Search Only Category

function search_only_category($query) { if (!is_admin() && $query->is_main_query() && $query->is_search) { $query->set(‘cat’, ‘3’); // Replace with category ID(s) } return $query; } add_filter(‘pre_get_posts’, ‘search_only_category’);Continue reading

Search Only Post

function search_only_post($query) { if (!is_admin() && $query->is_main_query() && $query->is_search) { $query->set(‘post_type’, ‘post’); } return $query; } add_filter(‘pre_get_posts’, ‘search_only_post’);Continue reading

Kitchen Renovation Estimator Edmonton

(function(){ /* ===== Gravity Forms settings: replace the numbers with your form and field IDs ===== */ var JKR_GF={ formId: 0, /* e.g. 7 */ fields:{ /* Hidden field IDs from the form editor */ home:0, scope:0, budget:0, contingency:0, total:0,…Continue reading

Print Invoice – Keep Untouched Template Labels Translatable

/** * Print Invoice & Delivery Notes: keep untouched template labels translatable * * WPCode: PHP Snippet, Insert Method “Auto Insert”, Location “Run Everywhere”. * * Templates::all() (includes/helpers/class-templates.php) merges the saved wcdn_template_settings * over defaults built with __() at request…Continue reading