How can I get the page or post language when I use wpml? [closed]

From The WPML website: http://wpml.org/documentation/support/wpml-coding-api/ Language constants WPML defines the following constants which can be used in the theme: Constant Description Example ICL_LANGUAGE_CODE Code for the current language fr ICL_LANGUAGE_NAME Name of current language, in the current language Français ICL_LANGUAGE_NAME_EN Name of the current language name in English French

problems with wordpress and php version 5.3.3-1

The latest and greatest php version is always the recommended version. Seriously. All core devs use it when developing trunk. Only a few bother to test older php versions, as can be seen by the occasional ticket opened related to php4 or php5.x incompatibility. The same cannot be said by plugin authors, however… As you … Read more

Missing sidebar parameter “fix” – before_content

This code detects whether a title has been set, and if not, it changes the before_widget argument. add_filter( ‘widget_display_callback’, ‘wpse4213_widget_display_callback’, 10, 3 ); function wpse4213_widget_display_callback( $instance, $widget, $args ) { if ( empty( $instance[‘title’] ) ) { $args[‘before_widget’] = ‘<div class=”container”><div class=”content”>’; $widget->widget( $args, $instance ); return false; } return $instance; } This code works … Read more

add_query_arg not working

If you take a look where the category_link hook is defined in category-template.php you’ll see this particular hook passes on two variables. The second variable is the category ID, but your callback function treats that second incoming variable as a query object. Simply put, you’re looking for a query_vars property/key that does not and cannot … Read more

How do I let users upload files to a chosen location?

In PHP, instead of: <form method=”POST” action=”url”> Use this instead: <form enctype=”multipart/form-data” method=”post” action=”url”> You can then fetch the resulting files using the $_FILES superglobal. In WP 3.1, the whole uploads infrastructure should be available as an API unless I’m mistaking. But it won’t necessarily work on the front end, let alone allow you to … Read more

How to run JS, PHP and etc. inside WP post?

Natively WordPress posts are subset of HTML (even more like semi-HTML – paragraph tags can be implied and added on output, but not stored). As result it really really doesn’t like to store or process active code in post’s content. This applies both to internal logic in PHP and front-end logic of post editor (it … Read more