Viewing 9 replies - 1 through 9 (of 9 total)
  • cstina

    (@cstina)

    Do you have a comment array set up?

    <?php
    $bm_trackbacks = array();
    $bm_comments = array();
    
    function split_comments( $source ) {
    
        if ( $source ) foreach ( $source as $comment ) {
    
            global $bm_trackbacks;
            global $bm_comments;
    
            if ( $comment->comment_type == 'trackback' || $comment->comment_type == 'pingback' ) {
                $bm_trackbacks[] = $comment;
            } else {
                $bm_comments[] = $comment;
            }
        }
    } ?>
    Thread Starter ghmercado

    (@ghmercado)

    In which file will i find this, cstina? I tried to do an extended search for ‘$bm_trackbacks’ thru all the files using my editor and didn’t find anything.

    Btw, comment moderation is set to on only for new commenters on my site.

    cstina

    (@cstina)

    ghmercado,

    Okay, I checked one of your posts in the 2nd category above… and it does have “Required” next to Mail and Name — in the “Leave a Reply” section. So, I’m not sure if you’ve changed the posting requirements AFTER you posted your problem. I also tried to leave a comment w/out an email… did not work (obviously).

    Anyhow, assuming you didn’t change the email requirement for posts… just make double sure that you have “Comment author must fill out name and e-mail” unticked in Options > Discussion > “Before a comment appears” …. then clear your cache and try commenting.

    The code above is something that can be “added to” functions.php…. so you’re not going to find it. The reason I brought it up is…. you don’t have any comment parameters in that php, and I assumed you were looking for a way to set up *separate* requirements for commenting PER category.

    If not, can you post your comments php code here… I’ll see if anything looks awry.

    .

    moshu

    (@moshu)

    If not, can you post your comments php code here

    NEVER say something like that! Read the forum Rules. Long code should be posted to a pastebin service, not here!

    cstina

    (@cstina)

    moshu,

    Sorry, we’re talking about the comment restriction part of the code… not the entire page. As you can see in the first post above, they’re talking about the “email required” element. That should only be about 6 lines.

    That’s why I said:

    “comments php code”

    and not

    “comments php page”

    Thanks for the heads up though.

    Thread Starter ghmercado

    (@ghmercado)

    thank you so much Cstina,

    I went ahead and unticked “Comment author must fill out name and e-mail” unticked in Options > Discussion > “Before a comment appears”, cleared my cache and the comment went through.

    However, I do want people to submit a valid email address as they leave a comment, although I am leaving that unticked for now just to get it to work.

    BTW, even as I disabled that feature, the word ‘required’ is still beside the email address box. No idea why.

    Here is my comments.php btw, thanks for taking the time.

    First try this (backup your comments.php first)

    Replace this:
    
    <label for="email"><small>Mail (will not be published)
     (required)</small></label>
    
    With this:
    
    <label for="email"><small>Mail (will not be published)
     <?php if ($req) echo "(required)"; ?></small></label>

    (Check for whitespace up there ^^^^)

    That tells the script to only put the word “required”
    IF it is required. If that doesn’t work, change it
    back. Since I’m not sure how your theme is setup,
    it might not be effective… but worth a try.

    (clear your cache after the changes)

    .

    Also ghmercado,

    BEFORE you try changing the code above, make sure….

    You go to Options > General > “Membership” and make sure you don’t have Registration Required (“Users must be registered and logged in to comment” should un UNticked). I assume you do NOT have it ticked as Required, but check. Btw, “Anyone can register” can remain ticked.

    That alone could be the culprit! If so, then you don’t need to change any code at all.

    .

    Thanks.
    oyun yeri

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Special Categories I created don’t allow comments if not logged in’ is closed to new replies.