Title: create a shortcode with nested shordcodes conditional language
Last modified: August 24, 2022

---

# create a shortcode with nested shordcodes conditional language

 *  Resolved [jpolkin](https://wordpress.org/support/users/jpolkin/)
 * (@jpolkin)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/create-a-shortcode-with-nested-shordcodes-conditional-language/)
 * Hi everybody,
 * I’m working on a bilingual site. i have two forms one in french and one in english
   with those shortcodes.
    So i tried to create a shortcode with nested shortcode
   conditional language but it doesn’t work.
 * here my code in function.php:
 *     ```
       <?php 
   
        function getProjectForm_shortcode($atts, $content = ""){
            $current_language = get_locale();
   
           if( $current_language == 'en_EN' ){
                if ($content) {
   
                   /$content = do_shortcode("[{$content}]");
            //here the shortcode [gravityform id="3" title="false"]
                }
            }
   
            if( $current_language == 'fr_FR' ){
                if ($content) {
   
                   $content = do_shortcode("[{$content}]");
          //here the shortcode [gravityform id="4" title="false"]
                }
           }
       }
        add_shortcode( 'getProjectForm', 'getProjectForm_shortcode' );
   
        ?>
       ```
   
 * And i put my shortcode [getProjectForm] in my page but nothing happen.
 * can you help me to solve this problem please
 * Big thanks in advance

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

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/create-a-shortcode-with-nested-shordcodes-conditional-language/#post-15943966)
 * What stands out first is that you’ve forgotten to return the content at the end
   of your function. You’ll need to add this:
 * `return $content;`
 * If it still doesn’t do anything, you should do some basic debugging with echo
   statements in your function to see what’s happening.
 *  Thread Starter [jpolkin](https://wordpress.org/support/users/jpolkin/)
 * (@jpolkin)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/create-a-shortcode-with-nested-shordcodes-conditional-language/#post-15947318)
 * [@catacaustic](https://wordpress.org/support/users/catacaustic/) Yeah tanks a
   lot a solve the problem
    Have a nice day 🙂

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

The topic ‘create a shortcode with nested shordcodes conditional language’ is closed
to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [jpolkin](https://wordpress.org/support/users/jpolkin/)
 * Last activity: [3 years, 9 months ago](https://wordpress.org/support/topic/create-a-shortcode-with-nested-shordcodes-conditional-language/#post-15947318)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
