• Resolved sam01389

    (@sam01389)


    Hey Ben

    please help me out

    1. Can you tell me how to change that text “You must be logged in to post a comment”? when I am clicking on it for registration it is redirecting me to wordpress registration page but I am using buddypress to register. I want it must redirect to buddypress registration page.

    https://bmania.in/wp/uncategorized/this-is-a-test-post/

    2. Tell me how I can remove “enter a comment…” from text area field box.

    3. how I can change post a comment button ?

    Thanks in advance

Viewing 10 replies - 1 through 10 (of 10 total)
  • Theme Author Ben Sibley

    (@bensibley)

    This can all be accomplished with a child theme. The only one I’m not totally sure about is #1.

    Download an empty Ignite child theme.

    1. Can you tell me how to change that text “You must be logged in to post a comment”? when I am clicking on it for registration it is redirecting me to wordpress registration page but I am using buddypress to register. I want it must redirect to buddypress registration page.

    I’m not that familiar with Buddypress, so you may want to repost this question on their support forum. However, I can tell you how to change the text and the URL to anything you’d like.

    In Ignite, there is a comments.php file. If you copy this entire file into a child theme, that copy will be used instead, so you can edit it as much as you’d like. The comment form has a few parameters (codex article) including one called must_log_in. You can set a variable in comments.php that defines the the must_log_in parameter as any link/text you’d like, and then pass that variable into the comment_form() function.

    That would work for changing the login URL. I’m just not sure if it’s the right way to do it for Buddypress. They may have a login override setting or hook for that.

    2. Tell me how I can remove “enter a comment…” from text area field box.

    You can add the following function to your child theme and modify it how you see fit:

    function ct_ignite_my_update_comment_field($comment_field) {
    
    	$comment_field =
    		'<p class="comment-form-comment">
                <label class="screen-reader-text">' . __('Your Comment', 'ignite') . '</label>
    			<textarea required placeholder="' . __('Enter Your Comment', 'ignite') . '…" id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>
    		</p>';
    
    	return $comment_field;
    }
    add_filter('comment_form_field_comment','ct_ignite_my_update_comment_field', 999);

    That’s the current output. There’s a placeholder attribute in there that you can remove.

    3. how I can change post a comment button ?

    You can edit the text in the submit button by setting another parameter in the comment_form() function in your comments.php file.

    Example:

    <?php comment_form(array('label_submit' => 'Click Me')); ?>

    That would change the submit button to say, “Click Me”. Coupled with your change to the login url, it would look something like this:

    <?php comment_form(array('label_submit' => 'Do Whatever', 'must_log_in' => $my_variable;)); ?>

    Okay, I hope that helps you get things just the way you want, but we can discuss the implementations with more detail if you’d like.

    Thread Starter sam01389

    (@sam01389)

    hi thanks for getting back.

    Its too much for me. Can u do me a favour. earlier I was not aware the use of child theme so I made some changes in core theme in comment.php.

    If I will share with you the whole coding and requirement so will u please provide amended code so I will put that in child theme.

    plz help me out. its very necessary.

    Theme Author Ben Sibley

    (@bensibley)

    Ah okay. Here is a child theme with the updates I shared in this post.

    The function in functions.php will remove the placeholder for you automatically. In the comments.php file you will see the other customizations on lines 23-26. The $new_login_url is currently set to the default value, and the submit button label is set to “Submit Button”. You can change both of these to whatever you’d like.

    To activate the child theme:

    1. Visit your site’s dashboard
    2. Go to the Appearance menu
    3. Click on the “Add New” button at the top of the page
    4. Click on the “Upload Theme” button at the top of the page
    5. Click on the “Choose File” button
    6. Select the tracks-child.zip file you downloaded from the link above
    7. Click the blue “activate” link

    You may have to reselect your menu locations after activating the child theme, but that should do the trick.

    Thread Starter sam01389

    (@sam01389)

    Thanks for your quick response and will try my best. ??

    Thread Starter sam01389

    (@sam01389)

    hi Ben

    All messed buddy. I ma using ignite and I did not check U gave me a link of Track theme. Now I activated it and lost my changes in parent theme.

    But its ok.

    Thread Starter sam01389

    (@sam01389)

    Hi #Ben

    codes you provided earlier worked for me and now problem is solved. Now I just want to manage font size. which code I need to look into ?

    I want to remove reply link on individual comments. Is it possible with CSS? I tried this but did not work.

    .comment-link {
    display: none;
    }

    Theme Author Ben Sibley

    (@bensibley)

    Oh I’m so sorry about that! Don’t know what I was thinking. So you’ve been able to make the comments updates properly?

    You can remove the reply link with the following CSS:

    .comment-reply-link {
      display: none;
    }

    For the font size, which text do you want to change the size of (ex. titles, post content)?

    Thread Starter sam01389

    (@sam01389)

    some of your codes and some tutorial php . i succeeded. is ignite child theme is not available ?

    I want to change font size for “be first to comment” and LEAVE A REPLY text, both are above comment box.

    Thread Starter sam01389

    (@sam01389)

    can I add some codes or CSS to prevent content from copy and print ?

    Theme Author Ben Sibley

    (@bensibley)

    Sure, here’s a child theme for Ignite with the previous changes added.

    You’ll see in the style.css file the code you need to modify the LEAVE A REPLY text. Right now, it’s just set to the default 26px.

    can I add some codes or CSS to prevent content from copy and print ?

    I’m sorry I don’t quite understand. You don’t want people to be able to copy your content?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Changes in comment form’ is closed to new replies.