• How to add a search function to NextGen gallery wordpress plugin?

    Psykotik writen a code for this function. Link to page.

    1. Add this code in your file search.php (inside your template folder), right after
    <h2 class=”pagetitle”>Search Results</h2>
    or somewhere (depending your template) after
    <?php if (have_posts()) : ?>,
    otherwise it wouldn’t find the pictures. Pay a special attention to the line
    $nggpictures = ngg_get_search_pictures($keywords, ”);
    since on the second function argument ( ” ) you may indicate the number of pictures you want to display on each row result. IE, if you want to get 6 pictures displayed on each row, you have to change the line to
    $nggpictures = ngg_get_search_pictures($keywords, ‘6’);
    By default, 4 pictures for each row are displayed. Note that you may also split the code, and put a part before and another part after the <?php while […] ?> function with the result to display pictures (if relevent) even if there is no post. That’s a bit more advanced, but people with advanced php skills won’t need any complementary explanation to achieve that.
    2. Add this code (or this code if you use NexGen 1.0) anywhere in your file functions.php (inside your template folder, create one if you don’t have any)

  • The topic ‘[Plugin: NextGEN Gallery] Search photos in the galleries of NextGEN plugin’ is closed to new replies.