Title: Try to making Custom Short Code
Last modified: August 22, 2016

---

# Try to making Custom Short Code

 *  [shawon mahmud](https://wordpress.org/support/users/shawon-mahmud/)
 * (@shawon-mahmud)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/try-to-making-custom-short-code/)
 * Hello
    I am try to making a custom shortcode in using jquery pretty photo plugin.
   Here is my functions (function.php)
 *  function img_gallery_blog_house () {
    wp_enqueue_script(‘jquery’); wp_enqueue_script(‘
   img_gallery_main’, get_template_directory_uri() . ‘/imggallery/js/jquery.prettyPhoto.
   js’, array(‘jquery’) ); wp_enqueue_script( ‘img_gallery_active’, get_template_directory_uri().‘/
   js/imggalleryactive.js’, array(‘jquery’) ); wp_enqueue_style( ‘img-gallery-defalt’,
   get_template_directory_uri() . ‘/imggallery/css/prettyPhoto.css’ ); } add_action(‘
   wp_enqueue_scripts’, ‘img_gallery_blog_house’ );
 *  function img_gallery_loop ($atts, $content = null){
 *  extract ( shortcode_atts ( array (
 *  ), $atts, ‘img-gallery’) );
 *  return ‘<div class=”main”>’ . do_shortcode($content) . ‘</div>’;
    } add_shortcode(‘
   img-gallery’, ‘img_gallery_loop’);
 *  function gallery_imgs_loop ($atts){
    extract ( shortcode_atts ( array ( ‘content’
   => ‘null’, ‘image’ => ”, ‘rel’ => ”, ‘link’ => ‘[http://&#8217](http://&#8217);,),
   $atts, ‘picture’) );
 *  return “[<img src=’$image’ alt=” />](https://wordpress.org/support/topic/try-to-making-custom-short-code/$link?output_format=md)“;
   }
   add_shortcode (‘picture’, ‘gallery_imgs_loop’);
 * But this functions is not working and I can’t fine the bugs. Please, help me

 The topic ‘Try to making Custom Short Code’ is closed to new replies.

## Tags

 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [wordpress theme development](https://wordpress.org/support/topic-tag/wordpress-theme-development/)

 * 0 replies
 * 1 participant
 * Last reply from: [shawon mahmud](https://wordpress.org/support/users/shawon-mahmud/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/try-to-making-custom-short-code/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
