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.