Title: php functions inside template
Last modified: August 20, 2016

---

# php functions inside template

 *  Resolved [ebenezer357](https://wordpress.org/support/users/ebenezer357/)
 * (@ebenezer357)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/php-functions-inside-template/)
 * Hi everyone,
    Im coding in some php codes inside a template i’m building and 
   i need to include a php inside another php but it gives me an error. This is 
   what i have:
 * <?php
    if(qtrans_getLanguage()==’en’) { echo “<?php more_fields(‘Author’) ?>;”}
   else { echo “Esta página esta en Español”; } ?>
 * Apparently it doens’t let me include php functions inside another php. I tried
   to declare a variable with the result of <?php more_fields(‘Author’) ?>; but 
   didn’t work either because in order to create a variable i need to have it inside
   a <?php right? or is there a way to declare variables without having to do them
   inside the <?php ??????
 * Anybody please help me out!
 * Thanks in advance for your help!
 * Note: Im using qTranslate and MoreFields for Translation and Custom Fields.

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/php-functions-inside-template/#post-3551367)
 * what is the exact error message?
 * there is likely to be a semicolon missing at the end of the ‘echo’ line.
 * generally, the echo function should be able to echo whatever you want, but it
   won’t execute the php code.
 * I don’t know the `more_fields()` function (is that from a plugin?), but have 
   you tried,
    either:
 *     ```
       echo more_fields('Author');
       ```
   
 * or:
 *     ```
       more_fields('Author');
       ```
   
 *  Thread Starter [ebenezer357](https://wordpress.org/support/users/ebenezer357/)
 * (@ebenezer357)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/php-functions-inside-template/#post-3551369)
 * Thank you alchymyth!!!
    more_fields(‘Author’); fixed my problem! Thanks a lot!
   🙂

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

The topic ‘php functions inside template’ is closed to new replies.

## Tags

 * [Codes](https://wordpress.org/support/topic-tag/codes/)
 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [ebenezer357](https://wordpress.org/support/users/ebenezer357/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/php-functions-inside-template/#post-3551369)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
