Support » Plugin: MCM Random Baby Name Generator » How To Show More than One Name? Like 10 or 20

  • Resolved tarul

    (@tarul)


    Hi
    Thank you for this plugin. The plugin works great and does exactly what it should do. But what can I do to make it show 10 to 20 names each time? Please guide me through the way. Or if possible please add this feature in next version

    regards
    Tarulahsan

    • This topic was modified 1 year, 2 months ago by tarul.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author mcmwebsol

    (@mcmwebsol)

    Hi Tarulahsan.

    Sorry for the delay in responding.
    If you change line 33886 from
    LIMIT 1″;
    to
    LIMIT 10″;

    and then change the part below that inside of
    if ( count($rows) ) {
    to
    foreach ($rows as $row)
    $ret .= ‘ <div class=”mcm-random-baby-name-generator-wp-result-container”><span id=”mcm-random-baby-name-generator-wp-result”>Name: ‘.$row[‘name’].'</span>’;

    it will return 10 names instead of just 1.
    Or change the 1 to 20 to return 20 names.

    So that section of code should look like

    
    $qs .= "       
                 ORDER BY RAND()
                 LIMIT 10";                      
                 
          $qs = $wpdb->prepare($qs, $params);                     
          $rows = $wpdb->get_results($qs, ARRAY_A);  
          if ( count($rows) ) {
             $row = $rows[0];   
             $ret = ' <div id="mcm-random-baby-name-generator-wp-result-container"><span id="mcm-random-baby-name-generator-wp-result">Name: '.$row['name'].'</span>';               
          }
    

    I may add this as an option in a future version.

    Thanks!

    Joseph

    Plugin Author mcmwebsol

    (@mcmwebsol)

    I added an option for this now on GitHub. I need to do more testing before adding it to the WordPress plugin directory.

    Thanks!

    Joseph

    Thread Starter tarul

    (@tarul)

    Many many thanks. I highly appreciate the support you are giving. Great Work. I love this plugin

    Plugin Author mcmwebsol

    (@mcmwebsol)

    Thanks Tarulahsan!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How To Show More than One Name? Like 10 or 20’ is closed to new replies.