Archive Orderby Title

add_action(‘pre_get_posts’, ‘change_archive_order’); function change_archive_order( $query ) { if ( $query->is_main_query() && !is_admin() && is_post_type_archive(‘post’) ) { // Replace ‘post’ with your desired post type $query->set(‘orderby’, ‘title’); $query->set(‘order’, ‘ASC’); } }Continue reading

fibosearch-search-by-brand

//https://fibosearch.com/documentation/tips-tricks/how-to-search-for-brands/ add_filter( ‘dgwt/wcas/indexer/taxonomies’, function ( $taxonomies ) { $taxonomies[] = array( ‘taxonomy’ => ‘pa_brand’, ‘labels’ => array( ‘name’ => ‘Brands’, ‘singular_name’ => ‘Brand’, ), ‘image_support’ => true, ); return $taxonomies; } );Continue reading

Localizing Date Picker Strings (copy)

/** * Load the date picker locale strings. * * @link https://wpforms.com/developers/localize-the-date-picker-strings/ */ function wpf_dev_datepicker_locale( $forms ) { if ( true === wpforms_has_field_type( ‘date-time’, $forms, true )){ wp_enqueue_script( ‘wpforms-datepicker-locale’, ‘https://npmcdn.com/[email protected]/dist/l10n/es.js’, array( ‘wpforms-flatpickr’ ), null, true ); } } add_action( ‘wpforms_frontend_js’,…Continue reading

SEO ( Mihai )

const DEBUG_SKINGURU24_SEO=false; /* * Urmatoarea functie doar pentru benchmarking snippet ul in dev process ( unused in prod ) */ function my_woocommerce_log_message($message) { if (class_exists(‘WC_Logger’)) { $logger = wc_get_logger(); $caller_function=”UNKNOWN”; $backtrace = debug_backtrace(); if (isset($backtrace[1])) { // The caller is…Continue reading

Others PHP ( Mihai )

function custom_urls_preload ( $urls ){ try { $language_code = substr(get_locale(),0,2); $api_url = ‘https://app-hintz.bbbone.biz/server/skinguru24/permalink_variations/’.$language_code; // Fetch the JSON data from the remote API $response = wp_remote_get($api_url); // Check for errors in the response if (is_wp_error($response)) { throw new Exception(‘API request failed:…Continue reading