Preserve custom URL parameter on more pages

You will need to intercept the links generated by WordPress and append the query var onto the relevant URLs. You can do this quite easily with a filter on category URLs with something like… function add_my_query_var( $link ) { $link = add_query_arg( ‘sort’, ‘most_voted’, $link ); return $link; } add_filter(‘category_link’,’add_my_query_var’); I also spotted this handy … Read more

How to force WordPress to temporarily switch locale (using qTranslate)? [closed]

And I got it. What was missing was re-loading the text domain for WooCommerce, that was loaded with the current locale at initialization: // set the current locale and send email with it active unload_textdomain(‘woocommerce’); setlocale(LC_ALL, $new_locale); global $q_config, $locale, $woocommerce; $locale = $new_locale; $q_config[‘language’] = substr($new_locale, 0, 2); $woocommerce->load_plugin_textdomain(); global $wc_cle_wc_email; $wc_cle_wc_email->customer_completed_order($order_id); // set … Read more

Load plugin on specific page only

I have figured it out. There is a good explanation here You edit the wp.config file with the scripts you wish to not load… define(‘WPCF7_LOAD_JS’, false); …and then manually enqueue them on the pages you wish to load the script.

Ways to have multiple front-page.php templates that can be swapped out?

One way is to have a single front-page.php and then using get_template_part(), to show different content based on user choice. Rough code: get_header(); $layout = get_option( ‘front_page_layout’, ‘default’ ); get_template_part( ‘front-page’, $layout ); get_footer(); After that you need to create a file for every layout, they should be called, something like: front-page-one.php front-page-two.php front-page-three.php front-page-default.php … Read more

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