Title: function not run!
Last modified: August 19, 2016

---

# function not run!

 *  [maniiiiac](https://wordpress.org/support/users/maniiiiac/)
 * (@maniiiiac)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/function-not-run/)
 * hi
 * i edited single.php in theme directory, i pu this code
 *     ```
       <?php 
   
       $tank = ($_GET['lang']); 
   
       if ($tank=="fa") {
            $myImage = "<IMG SRC =assets/img/scenert.png>";
       } 
   
       if ($tank=="en") {
            $myImage = "<IMG SRC =assets/img/scenerten.png>";
       }
       ?> 
   
       <?php
       /**
        * @package WordPress
        * @subpackage Default_Theme
        */
   
       get_header(); ?>
   
       <div id="maincontainer">
       <div id="contentwrapper">
       <div id="contentcolumn" class="background:#999999 url() right no-repeat;
       ">
       <div class="innertube">test<?php print $myImage; ?></div>
       </div>
       </div>
   
       <div id="rightcolumn">
       <div class="innertube"> 
   
       	<?php if (have_posts()) : ?>
   
       		<?php while (have_posts()) : the_post(); ?>
   
       			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
       				<div class="entry">
       					<?php the_content('Read the rest of this entry &raquo;'); ?>
       				</div>
   
       			</div>
   
       		<?php endwhile; ?>
   
       		<div class="navigation">
       			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
       			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
       		</div>
   
       	<?php else : ?>
   
       		<h2 class="center">Not Found</h2>
       		<p class="center">Sorry, but you are looking for something that isn't here.</p>
       		<?php get_search_form(); ?>
   
       	<?php endif; ?>
   
        </div>
       </div>
       </div>
   
       	</div>
       ```
   
 * in this line
 *     ```
       <div class="innertube">test<?php print $myImage; ?></div>
       ```
   
 * <?php print $myImage; ?> not run in my page
    what’s wrong??
 * i tested myself code in a single page
 *     ```
       <?php 
   
       $tank = ($_GET['lang']); 
   
       if ($tank=="fa") {
            $myImage = "<IMG SRC =assets/img/scenert.png>";
       } 
   
       if ($tank=="en") {
            $myImage = "<IMG SRC =assets/img/scenerten.png>";
       }
       ?>
       <div class="innertube">test<?php print $myImage; ?></div>
       ```
   
 * and works fine

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

 *  [Nutrawee](https://wordpress.org/support/users/zeally/)
 * (@zeally)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/function-not-run/#post-1216753)
 * I think that it has been run, but the image didn’t appear because the path is
   incorrect.
 *  Thread Starter [maniiiiac](https://wordpress.org/support/users/maniiiiac/)
 * (@maniiiiac)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/function-not-run/#post-1216956)
 * path is correct, but i test with full path and it’s not run
 *  [Nutrawee](https://wordpress.org/support/users/zeally/)
 * (@zeally)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/function-not-run/#post-1216957)
 * 1. If you use WP super cache, don’t forget to deactivate it.
    2. Check that you
   properly pass correct _lang _value: fa or en
 * If you try
 * `<div class="innertube">test<?php print 'test'; ?></div>`
 * I think you will see ‘test’ on your page.
 *  Thread Starter [maniiiiac](https://wordpress.org/support/users/maniiiiac/)
 * (@maniiiiac)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/function-not-run/#post-1216958)
 * 1. i’m not use Wp Super Cache
    2. yes, i see test in my page. . . it’s work on
   print or echo with any text [like: ‘test’;]but not runs $myimage 🙂
 *  [Nutrawee](https://wordpress.org/support/users/zeally/)
 * (@zeally)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/function-not-run/#post-1216959)
 * try
 *     ```
       <?php 
   
       $myImage = 'abc';
       $tank = ($_GET['lang']); 
   
       if ($tank=="fa") {
            $myImage = "<IMG SRC =assets/img/scenert.png>";
       } 
   
       if ($tank=="en") {
            $myImage = "<IMG SRC =assets/img/scenerten.png>";
       }
       ?>
       ```
   
 * if you see abc on your page, it means the problem is $tank
 *  Thread Starter [maniiiiac](https://wordpress.org/support/users/maniiiiac/)
 * (@maniiiiac)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/function-not-run/#post-1216960)
 * i say heretofore, that it’s work with any test
 * ——
 * i test your code and i see ABC in any lang!
 *  [Nutrawee](https://wordpress.org/support/users/zeally/)
 * (@zeally)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/function-not-run/#post-1216961)
 * Stay cool … I’m trying to help you
    The php code has been run. So, it means the
   problem is $tank.
 *  Thread Starter [maniiiiac](https://wordpress.org/support/users/maniiiiac/)
 * (@maniiiiac)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/function-not-run/#post-1216984)
 * i’m waiting for you Dear Zeally!
 *  [Nutrawee](https://wordpress.org/support/users/zeally/)
 * (@zeally)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/function-not-run/#post-1216985)
 * Sorry, I have tried this code in my local and it work well.
 * First, you have check the $tank value by using this code.
 * > <div class=”innertube”>test<?php print ‘[‘ . $tank . ‘]’; ?></div>
 * If there is nothing in “[]”, it means that your testing method is wrong.
    Your
   testing url should be like this
 * > localhost/mysite/post/?lang=en
 *  Thread Starter [maniiiiac](https://wordpress.org/support/users/maniiiiac/)
 * (@maniiiiac)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/function-not-run/#post-1217002)
 * my testing URL not wrong!
    i installed qTranslate on my blog. . . the language
   change From this plugin. and i want to change one of my pictures in site with
   this Query (?lang)
 * but above code works fine when qTranslate is Deavtive. . .and also not works 
   when qTranslate is Active

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

The topic ‘function not run!’ is closed to new replies.

## Tags

 * [function](https://wordpress.org/support/topic-tag/function/)
 * [print](https://wordpress.org/support/topic-tag/print/)

 * 10 replies
 * 2 participants
 * Last reply from: [maniiiiac](https://wordpress.org/support/users/maniiiiac/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/function-not-run/#post-1217002)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
