Bulk assign posts to a category using SQL (MySQL)

OK, I think I found the answer myself… As stated in the post I linked to: wp_term_taxonomy – defines the taxonomy – either tag, category, or custom taxonomy term_taxonomy_id bigint(20) unsigned NOT NULL auto_increment, term_id bigint(20) unsigned NOT NULL default 0, taxonomy varchar(32) NOT NULL default ”, description longtext NOT NULL, parent bigint(20) unsigned NOT … Read more

Change WooCommerce currency programmatically on AJAX request

This is how I solved it: /** * Force currency change */ add_filter( ‘wcml_client_currency’, function($current) { if(isset($_GET[‘currency’]) && $_GET[‘currency’]) return $_GET[‘currency’]; if(isset($_POST[‘currency’]) && $_POST[‘currency’]) return $_POST[‘currency’]; return $current; } ); And then in order for the above filter to be listened to, it’s important that you have added below code: add_action( ‘wp_ajax_quick_view_single_product’, __NAMESPACE__ . ‘\\quick_view_single_product’ … Read more

How to change the canonical link from a category or taxonomy archive?

I found the solution by myself: function yoast_seo_canonical_change_archives( $canonical ) { if ( is_tax( ‘tourist-spots’ ) ) { $path = parse_url( $canonical, PHP_URL_PATH ); return ‘https://www.luxuryvillasphuketthailand.com’ . $path; } return $canonical; } add_filter( ‘wpseo_canonical’, ‘yoast_seo_canonical_change_archives’, 10, 1 );

Translate string inside twig template

I managed to assign a variable to context. $context = Timber::get_context(); $context[‘search_placeholder’] = __(“Suche”,”pixel_framework”); Timber::fetch(‘test.twig’,$context); inside twig <input type=”text” id=”s” name=”s” value=”” placeholder=” {{search_placeholder}}”>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)