How create own custom smart gallery & shortcode using NextGen Gallery!

For integrate custom Gallery using NexnGen Gallery just follow code given below
You can add JQuery Image gallery in your wordpress site using this code.
/** Custom gallery function **/
function rgallery_func($atts) {
'id' => 'no foo',
'bar' => 'default bar'
), $atts));
$ID=$atts[id]; //retrieve NextGen Gallery ID passed in short code
/** Get Main gallery image root path **/
$Qryslug="select path from wp_ngg_gallery where gid='$ID'";
$queryslug = mysql_query($Qryslug);
/** Get gallery images **/
$Qry="select * from wp_ngg_pictures where galleryid='$ID'  and exclude=0 order by pid desc";
$query = mysql_query($Qry);
if (mysql_num_rows($query) > 0) {
echo ' <div id="gallery">
$Titlle =stripslashes($Arry['alttext']);
$FileName =$Arry['filename'];
$descr =stripslashes($Arry['description']);
echo '<li>
<a href="'.home_url('/').$GalleryPath.'/'.$FileName.'"  title="'.$Titlle.'">
<img src="'.home_url('/').$GalleryPath.'/thumbs/thumbs_'.$FileName.'"  title="'.$Titlle.'" alt="'.$descr.'">
echo '</ul>
} else {
echo '<img src="' . home_url('/') . 'wp-content/themes/suchdesign/images/no-image.jpg">';
add_shortcode('rgallery', 'rgallery_func');//Just add short code [rgallery id=GalleryID] in your page
 //Add custom JQuery in header
function add_jquery_header()
echo '<script src="your-root-path/filename"></script>\n';
echo '<script src="your-root-path/filename"></script>\n';

For any further enquiry please contact to our support team

One Reply to “How create own custom smart gallery & shortcode using NextGen Gallery!”

Leave a Reply

Your email address will not be published. Required fields are marked *