Title: php code if language
Last modified: August 21, 2016

---

# php code if language

 *  Resolved [sladkoe6ka](https://wordpress.org/support/users/sladkoe6ka/)
 * (@sladkoe6ka)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-code-if-language/)
 * how should I modify php code on the following page, keeping in mind that for 
   English should be taken `<?php for ($i = 1; $i <= 3; $i++) { ?>`
    but for other
   languages `<?php for ($i = 4; $i <= 6; $i++) { ?>`? Your help will be highly 
   appreciated
 *     ```
       <?php get_header(); ?>
   
       	<div id="content-top"<?php if (get_option('professional_blog_style') == 'on') echo(' class="top-alt"'); ?>></div>
       	<div id="content" class="clearfix<?php if (get_option('professional_blog_style') == 'on') echo(' content-alt'); ?>">
       		<?php if (get_option('professional_blog_style') == 'false') { ?>
   
       			<?php for ($i = 1; $i <= 3; $i++) { ?>
       				<?php query_posts('page_id=' . get_pageId(html_entity_decode(get_option('professional_service_'.$i)))); while (have_posts()) : the_post(); ?>
       					<div class="service">
       						<?php $icon = '';
       						$icon = get_post_meta($post->ID, 'Icon', true);
       						$tagline = '';
       						$tagline = get_post_meta($post->ID, 'Tagline', true); ?>
   
       						<?php if ($icon <> '') { ?>
       							<img class="service-icon" alt="" src="<?php echo esc_url($icon); ?>"/>
       						<?php }; ?>
   
       						<h3 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
   
       						<?php if ($tagline <> '') { ?>
       							<span class="tagline"><?php echo esc_html($tagline); ?></span>
       						<?php }; ?>
   
       						<div class="hr"></div>
       						<?php global $more;
       						$more = 0;
       						the_content(""); ?>
       						<a href="<?php the_permalink(); ?>" class="readmore"><span><?php esc_html_e('read more','Professional'); ?></span></a>
       					</div> <!-- end .service -->
       				<?php endwhile; wp_reset_query(); ?>
       			<?php }; ?>
   
       		<?php } else { ?>
       			<div id="content-area">
       				<?php get_template_part('includes/entry','home'); ?>
       			</div> <!-- end #content-area -->
   
       			<?php get_sidebar(); ?>
   
       		<?php }; ?>
   
       	</div> <!-- end #content-->
       	<div id="content-bottom"<?php if (get_option('professional_blog_style') == 'on') echo(' class="bottom-alt"'); ?>></div>
   
       <?php get_footer(); ?>
       ```
   
 * [http://wordpress.org/plugins/ceceppa-multilingua/](http://wordpress.org/plugins/ceceppa-multilingua/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Alessandro Senese aka Ceceppa](https://wordpress.org/support/users/ceceppa/)
 * (@ceceppa)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-code-if-language/#post-4334678)
 * You can use the function “cml_get_current_language()” for retrieve info about
   current language….
    So you can write something like this:
 * <?php
 * $current = cml_get_current_language();
 * //cml_language_slug is the same of “Url slug”
    $min = ( $current->cml_language_slug
   == “en” ) ? 1 : 4; $max = $min + 2;
 * for( $i = $min; $i < $max; $i++ ) ….
 * ?>
 *  Thread Starter [sladkoe6ka](https://wordpress.org/support/users/sladkoe6ka/)
 * (@sladkoe6ka)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-code-if-language/#post-4334726)
 * thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘php code if language’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ceceppa-multilingua_4faedb.svg)
 * [Ceceppa Multilingua](https://wordpress.org/plugins/ceceppa-multilingua/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ceceppa-multilingua/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ceceppa-multilingua/)
 * [Active Topics](https://wordpress.org/support/plugin/ceceppa-multilingua/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ceceppa-multilingua/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ceceppa-multilingua/reviews/)

## Tags

 * [if](https://wordpress.org/support/topic-tag/if/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 2 replies
 * 2 participants
 * Last reply from: [sladkoe6ka](https://wordpress.org/support/users/sladkoe6ka/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/php-code-if-language/#post-4334726)
 * Status: resolved