Need review form

This topic contains 5 replies, has 2 voices, and was last updated by  Kor 6 years, 4 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #451331

    James Gehring
    Expired Member
    Post count: 34

    I want to add the review form to a pop up. How can I display just the form? I don’t need help with the popup just getting the form to add to it.

    #451345

    Kor
    Moderator
    Post count: 16516

    Hi James,

    Do you mean you want to display the “Review form” from the review tab into a popup? If not, could you elaborate with some screenshots?

    Thanks!

    #451346

    James Gehring
    Expired Member
    Post count: 34

    That is exactly what I want to do.

    #451356

    Kor
    Moderator
    Post count: 16516

    Hi James,

    Unfortunately, that wouldn’t be possible without customization. You can always reach out some of our Gd experts here http://geodirectoryexperts.com/ for customization services.

    Thanks!

    #451365

    James Gehring
    Expired Member
    Post count: 34

    Sure thing.

    Here is a solution for anyone who wants to do this in the future. This is using bootstrap 3 modal.
    The link

    <a data-toggle="modal" data-target="#reviewModal" class="jtf=info-box-link">Leave a Review</a>

    Add to footer.php you may need adjust your login url if it is not /login

    
    
    <?php
      if ( get_post_type( get_the_ID() ) == 'gd_place' ) {
    $current_user = wp_get_current_user();
    
    echo '<div class="modal fade" id="reviewModal" tabindex="-1" role="dialog" aria-labelledby="reviewModalLabel">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="reviewModalLabel">';
            the_title();
            echo '</h4>
          </div>
          <div class="modal-body">';
    if(is_user_logged_in()){
    
        echo '
        <form action="/wp-comments-post.php" method="post" id="commentform" class="comment-form">
       <p class="logged-in-as"><a href="/wp-admin/profile.php" aria-label="Logged in as '. $current_user->display_name .'
       <div class="br-wrapper br-theme-fontawesome-stars">
          <select class="gd-fa-rating" style="display: none;">
             <option value=""></option>
             <option value="1">Terrible</option>
             <option value="2">Poor</option>
             <option value="3">Average</option>
             <option value="4">Very Good</option>
             <option value="5">Excellent</option>
          </select>
        
       </div>
       <input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="0">
       <p class="comment-form-comment"><label for="comment">Review text <span class="required">*</span></label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" required=""></textarea></p>
       <p class="form-submit"><input name="submit" type="submit" id="submit" class="submit" value="Post Review"> <input type="hidden" name="comment_post_ID" value="'. $post->ID .'" id="comment_post_ID">
          <input type="hidden" name="comment_parent" id="comment_parent" value="0">
       </p>
       <input type="hidden" id="_wp_unfiltered_html_comment_disabled" name="_wp_unfiltered_html_comment" value="4ff31c56bd">
    </form>'; }else{
    
            echo '<p>
            You need to be logged in to leave a review <a href="/login/?redirect_to='.get_the_permalink($post->ID).'">Login Now</a>
            </p>';
    
          }
    
          echo '</div>
    
        </div>
      </div>
    </div>';
    
    } ?>
    #451485

    Kor
    Moderator
    Post count: 16516

    Hi James,

    Thank you very much for sharing the solution. Really appreciate it.

    Thanks!

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount