title: Add php code inside the function add_shortcode in functions.php Wordpress
body: <p>How I can add php code inside the function add_shortcode in functions.php</p>
  
  <p>For Example:</p>
  
  <pre><code>&lt;?php $images = get_field('img_novinki'); if( $images ) { ?&gt;
  
  
  &lt;div id="carousel" class="flexslider"&gt;
      &lt;ul class="slides gallery"&gt;
          &lt;?php foreach( $images as $image ): ?&gt;
              &lt;li&gt;
                  &lt;a href="&lt;?php echo $image['url']; ?&gt;"&gt;&lt;img src="&lt;?php echo $image['sizes']['thumbnail']; ?&gt;" alt="&lt;?php echo $image['alt']; ?&gt;" /&gt;&lt;/a&gt;
              &lt;/li&gt;
          &lt;?php endforeach; ?&gt;
      &lt;/ul&gt;
  &lt;/div&gt; &lt;?php } ?&gt;
  </code></pre>
  
  <p>Shortcode in functions PHP:</p>
  
  <pre><code>function my_novinki( $atts ) 
  {
      return '';
  }
  add_shortcode( 'my_novinki', 'my_novinki');
  </code></pre>