WordPress help needed - comment form

Discussion in 'PHP' started by steveb, Jan 30, 2014.

  1. #1
    Hi,

    I'm trying to customize my comment form on WP. I have this piece of php code that I want to insert into my existing code:
    Existing code:
    I would like to place it right below the 'title_reply' line.

    Please advise. Thanks in advance!
     
    steveb, Jan 30, 2014 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    How does the function "the_stars" look? Depending on what it outputs, it should be possible to insert it, even in the array, if need be. But it again depends on what it spits out, since if, for instance, it spits out its own form, you can't insert it into an existing form, and you might have to rewrite either function - either the the_stars-function, and its output, or the comment_form-function, and how it accepts input.
     
    PoPSiCLe, Jan 31, 2014 IP
  3. Hefaistos

    Hefaistos Active Member

    Messages:
    194
    Likes Received:
    14
    Best Answers:
    9
    Trophy Points:
    63
    Digital Goods:
    1
    #3
    If I'm not mistaken, "the_stars" function in WordPress comes from a star rating plugin and should display a star rating system . See if it's everything ok if you change the "'title_reply' => 'Comment'," row with:
    
    // Above the comment_form function
    $stars_rating = function_exists('the_stars') ? the_stars() : false ;
    
    <?php
    'title_reply' => 'Comment' . $stars_rating,
    ?>
    PHP:
     
    Last edited: Jan 31, 2014
    Hefaistos, Jan 31, 2014 IP
  4. steveb

    steveb Well-Known Member

    Messages:
    1,434
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    175
    #4
    Yes, it's a ratings plugin. That function outputs an image of stars as ratings.

    I did as you said, but it doesn't work.

    Any ideas?
     
    steveb, Jan 31, 2014 IP