-
AuthorPosts
-
March 10, 2020 at 4:38 pm #1191906
Hi Folks,
new question – “How to change comment box text?” …is a headline in the
enfold-documentation. And that is exactly what I want to do, but it’s not really
working with your example-snippet:
——————————————————————————————-
//————————————–
// function – Comment box text
//————————————–function custom_comment_title(){
?>
<script>
jQuery(window).load(function(){// Replace coments title “Leave a Reply”.
jQuery(“.single-post .miniheading”).text(“New text here”);// Replace sub-heading “Want to join the discussion? Feel free to contribute!”.
jQuery(“.single-post .minitext”).text(“New text here”);// Replace submit button text “Post Comment”.
jQuery(“.single-post .submit”).val(“New text here”);});
</script>
<?php
}
add_action(‘wp_head’, ‘custom_comment_title’);——————————————————————————————-
Please, take a look on my page. I only want to change the “comment title”! And I
want to delete the sub-headings. And I also want to delete the complete “website-field”.Incidentally – a big “THANK YOU” to all of you for your support! You do a great job!
Best regards
CarstenMarch 10, 2020 at 10:41 pm #1192041Hey Carsten,
Here is the code you can put in Enfold > General Styling > Quick Css, if it does not work, put into themes/enfold/css/custom.css
#top #wrap_all .comment-form-url { display: none; }
Please try the code like this:
function custom_comment_title(){ ?> <script> jQuery(window).load(function(){ // Replace coments title “Leave a Reply”. jQuery("#top .comment_container .miniheading").text("New text here"); // Replace sub-heading “Want to join the discussion? Feel free to contribute!”. jQuery("#top .comment_container .minitext").text("New text here"); // Replace submit button text “Post Comment”. jQuery("#top .comment_container .submit").val("New text here"); }); </script> <?php } add_action('wp_head', 'custom_comment_title');
If you need further assistance please let us know.
Best regards,
VictoriaMarch 11, 2020 at 2:32 pm #1192289Hi Victoria,
thx again for your reply and the new infos!
Unfortunately the code is not working at all
and it doesn’t matter if I put the code in the
“Quick-CSS-Box“ or in the “Custom.css“…sorry!I created a new screenshot…please take a
new look on it. I hope it helps.In my other post you asked me after an temporary
admin access. Maybe it’s help here, too?PS: Right now I noticed, that the “website-field“ is
disappeared…great! Your first snippet do that. I thought
that this snippet is for the subtext. So, that problem is fixed
already! :-) But your other code is not working in the custom.css.
Look at the second screenshot and you’ll see.
Best regards
Carsten- This reply was modified 4 years, 8 months ago by designbasis.
March 11, 2020 at 5:13 pm #1192364Hi designbasis,
This code:
has to be added in the functions.php file, this is NOT CSS! And you need to add the child theme first and then add the code there in the functions.php file, otherwise, changes will be gone with the theme update.To switch from your parent theme to the child theme and retain your same settings please follow these steps, first with your parent theme active go to Enfold Theme Options > Import/Export > Export Theme Settings File and download your theme settings file for fallback.
then activate your child theme and ensure your Enfold Theme Options > Performance > JS & CSS file merging and compression is turned off along with any caching plugins, then go to Enfold Theme Options > Import/Export > Import Settings From Your Parent Theme and import, then go to your homepage and clear your browser cache a couple of times and check that the settings have taken effect.
If it doesn’t look quite right then check that your Enfold Theme Options > Performance > JS & CSS file merging and compression is turned off and clear your browser cache a couple of more times.
If still not quite right, then go to Enfold Theme Options > Import/Export > Import Theme Settings File and upload the theme settings file you saved earlier, and clear your browser cache a couple of more times.Best regards,
VictoriaMarch 11, 2020 at 8:06 pm #1192412Hi Victoria,
thx for your new reply! Now everthing is fine! I’ve already installed the child-theme,
but I didn’t notice that the other code was for the functions.php, sorry! ;-)BUT – you didn’t read my last reply also thoroughly, did you? ;-)
Please, take another look on my last screenshot. I need a further code for the
field-colour and the text-colour. Would you please so kind?…thank you! :-)And a little addition – in the answer-mode I wanna change also the title!
Please, look at the second screenshot. Thank you very much!Best regards
Carsten- This reply was modified 4 years, 8 months ago by designbasis.
March 12, 2020 at 8:37 pm #1192753Hi Carsten,
Here is the code you can put in Enfold > General Styling > Quick Css, if it does not work, put into themes/enfold/css/custom.css
.comment_text p, #top #commentform label { color: #ccc; } #top #wrap_all .comment-form-url { display: none; } #top .main_color input[type="text"] { background-color: #aa5356; }
If you need further assistance please let us know.
Best regards,
VictoriaMarch 13, 2020 at 3:20 pm #1192897Hi again Victoria,
thx for the new code-snippets! They work, but unfortunately not perfect.
At first – I don’t know exactly for what this snippet should be:
———————————————————-
#top #wrap_all .comment-form-url {
display: none;
}
———————————————————-After putting your complete new snippets into the “custom.css“ the colour of
the field and text is now correct!But now the colour of the text within the fields is also white and by writing it,
it’s not showing up directly in the field. You also can’t see the cursor if you
click into the field. But after writing invisible, the text is anyhow in the field.
Please, try by yourself and you’ll see what I mean. I also made a screenshot
of it.And please take another look at the “answer-mode” together with the second
screenshot! There are 3 more little probs to solve. Thanks very much!Best regards
Carsten- This reply was modified 4 years, 8 months ago by designbasis.
March 17, 2020 at 12:58 pm #1193784Hi,
This code:#top #wrap_all .comment-form-url { display: none; }
is to hide the “website” field.
To change the color of the text when entered into your form so it is red and not the same orange as the background color, Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:#top .main_color input[type="text"], #top .main_color select { color: #720c10 !important; }
Best regards,
MikeMarch 17, 2020 at 7:01 pm #1193886Hi Mike,
thank you for your new reply! And of course this snippet hide the
“website field“…who can read has an advantage, right? ;-) Sorry,
for that stupid question.And your new snippet works perfect…thx again! Now, this thing
is solved. :-) But as I has written it in bold in the last entry – 3
little things are left…in the answer-mode. Please, take a new look
at the screenshot and you’ll understand immediately. If you can
help me with that probs too, I’ll be very happy! :-)Best regards
CarstenMarch 18, 2020 at 12:03 pm #1194080Hi,
Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:#respond span.required { display: inline-block !important; } .commentlist #respond #comment { width: 100% !important; }
and then add this code to the end of your functions.php file in Appearance > Editor:
function custom_reply_title(){ ?> <script> (function($){ $(document).ready(function(){ $("h3#reply-title").text("Liebes Publikum, schreib mir doch etwas Nettes :-)"); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_reply_title');
Best regards,
MikeMarch 18, 2020 at 4:05 pm #1194142Hi Mike,
thx for your new answer and code!
The snippet for the “Quick CSS” works perfect, but after I put the new code-lines
into the functions.php file there is small failure. If you click right now on “answer“
then not the answer-mode opens but it links to the commentary-field. So, there
must be a little mistake, but I’m sure you’ll find him! :) Take a look on the new screen-
shot. That is the current functions.php file.Best regards
CarstenMarch 18, 2020 at 4:38 pm #1194165Hi again Mike,
sorry, but I discovered unfortunately another small failure with Victorias
last code-snippets:
————————————————————————————
.comment_text p,
#top #commentform label {
color: #ccc;
}
#top #wrap_all .comment-form-url {
display: none;
}
#top .main_color input[type=”text”] {
background-color: #aa5356;
}
————————————————————————————
They working as far as good in the “commentary-area“, but unfortunately
these snippets clash with the “contact-form“. Take a look at the screenshots.
If the code is not in than the contact-form looks like png1 and if they in it
looks like png2. So, what is here to do?Best regards
CarstenMarch 19, 2020 at 12:44 pm #1194395Hi,
For the contact form please remove this part of the css:#top .main_color input[type="text"] { background-color: #e69d37; }
so we can see how to adjust it, and also remove the code in the functions.php that I gave you that is causing the error.
It may be easier if we had an admin login so we can adjust these snippets.Best regards,
MikeMarch 19, 2020 at 7:36 pm #1194553Hi Mike,
thx for your new answer and the infos!
Ok, with removing the snippet the problem with the contact form is
“half solved“. ;-) Because now I have a new small prob with the text-
colour in the fields. I thought it was solved, but maybe there is another
snippet which is colliding with another snippet. ;-/ Please, take a look
at the screenshot and you’ll see.I think it has to do with this snippet…am I right?
———————————————————————————
#top .main_color input[type=”text”] , #top .main_color select
{
background-color: #720c10;
color: #e69d37;
border: none;
}
———————————————————————————
Actually the colours in the snippet are correct, but they aren’t show up
correctly in the frontend. Because at the moment the text-colour is
the same as the background-colour. And further I want to change the
colour of the name of the main-textfield, as you can see in the screenshot.By the way… you’ll find the admin-login-data in the private content field. :)
Thanks again for your help!
Best regards
CarstenMarch 20, 2020 at 1:37 pm #1194790Hi,
Thanks for the login, on the contact form what color do you want the “Nachricht” text? Are the other placeholders colors correct?
The placeholder color for the “Nachricht” text is set by:.responsive #top ::placeholder { color: #ad0e08; opacity: 1; font-family: 'Montserrat Alternates', sans-serif; font-size: 17px!important;; }
So what is wrong with this is that it is too general and it sets the color to all placeholders, I recommend setting a custom class for the contact form:
you can add this custom class to all of your contact forms, and then change the css to this:.responsive #top .contact-form ::placeholder { color: blue !important; }
Notice I changed the color to blue just for example to show that this doesn’t change the color on the comment forms.
For the other placeholders please try:#top #wrap_all #main .main_color .contact-form input::placeholder,#top #wrap_all #main .main_color .contact-form span.value_verifier_label { color: blue !important; }
This will change the color of the input text:
#top .main_color .contact-form input[type="text"]{ color: blue !important; }
Best regards,
MikeMarch 20, 2020 at 6:43 pm #1194862Hi Mike,
thx again for your answer and the new informations!
After a second’s thought I did understand and now the contact form is
like I wanted to have…fine! :-)But unfortunately the comment fields now have a new problem again,
which has actually already been solved ;-/ The placeholder-fields
have the wrong colour again…in the “basic-mode“ and in the “answer-
mode“, too. We know the answer already. It is this snippet:
——————————————————————————–
#top .main_color input[type=”text”] {
background-color: #e69d37;
}
——————————————————————————–
It collides with the contact-form-placeholder-fields! And now?And there is still another prob left…I wanted to change the title of the
answer-mode. If you could give me a solution for that also, it would
be great!Best regards
CarstenMarch 21, 2020 at 1:41 pm #1195057Hi,
For the contact form “name” & “email” we will adjust the css to target the contact form, I added this:#top .main_color #commentform input[type="text"] { background-color: #e69d37; }
note the added “#commentform”
Best regards,
MikeMarch 21, 2020 at 10:17 pm #1195148Good evening Mike,
thx for your new reply and the support! I think, now it works…contact-
and comment-form…super! Is it possible that in your first sentence
you wanted to write “comment form” instead of “contact form”? It seems
so to me. But anyway…now both parts working well and that is the
most important! Thanks again!Ok, but there is further a small “but“…please take a look again on the
screenshot_2. I wanna still change the title in the answer-mode. Would
you please so kind? :)Best regards
CarstenMarch 22, 2020 at 3:36 pm #1195250Hi,
Glad to hear this helps. As for the “answer-mode” title, I’m having trouble because the two modes are actually combined and it seems that anything I add was braking it.
But I believe I have it working with this function:function custom_hard_script(){ ?> <script> (function($){ $(document).click(function(){ if ($('.commentlist #reply-title').css('display') == 'block'){ $("#reply-title").html(function() { return $(this).html().replace("Schreibe einen Kommentar", "Liebes Publikum"); }); } else {} }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_hard_script');
just change “Liebes Publikum” in the code to what you wish.
Try adding this code to the end of your functions.php file in Appearance > Editor and Then clear your browser cache and any cache plugin, and check.
I also believe that you may need to log out from admin to see the “answer-mode”Best regards,
MikeMarch 22, 2020 at 4:19 pm #1195255Bon Sunday Mike,
thanks very much…now everything is fine! The new code works great! :)
And again, sorry for this inconvenient wish! True to the motto: why easy,
when it can also be difficult? See you soon at the next problem! ;)Best regards
CarstenMarch 22, 2020 at 5:42 pm #1195266 -
AuthorPosts
- The topic ‘How to change comment box text?’ is closed to new replies.