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

Correct way to serialize the data of options table?

The correct way to store multiple options is as a multidimensional array and save to one option field. $myopt = array( ‘variable1’ => … ‘variable2’ => … …. ); Then simply pass the array to update_option() update_option(‘my_settings_field’, $myopt); If you pass an array WP will auto serialize the data for you. Then to read back … Read more

Is there a plugin for posting inline comments, like in MS Word? [closed]

There is a plugin with that readers can post comments inline, like in Microsoft Word. The WordPress plugin bases on inlineDisqussions by Tsi and is called Inline Comments: http://wordpress.org/plugins/inline-comments/ Inline Comments adds the great Disqus Comment System to the side of paragraphs and other specific sections (like headlines and images) of your post.