Before you ask please READ THIS

Leave a Reply / Post a comment

I would like to change the title in the comment field in the bottom of the post section from "Leave a reply" to "Post a comment" as this makes more sense if there are no comments on the post initially.

I can see in plenty of Wordpress forums how to achieve this with code like this:

function wpb_comment_reply_text( $link ) { $link = str_replace( 'Leave a reply', 'Post a comment', $link ); return $link; } add_filter( 'comment_reply_link', 'wpb_comment_reply_text' );

But adding this to either functions.php or a13_framework_cpt.php doesnt change this.

Any ideas?


Thanks

Comments

  • AirAir
    Posts: 10,970
    chillwiddastill said: But adding this to ... or a13_framework_cpt.php doesnt change this.
    Don't work blindly, as it can create more harm then good. This file is from external plugin responsible for Custom Post Types.

    You tried in proper place(functions.php), but had wrong code, for different thing(for link probably), and you want to change title. Add this to funtions.php
    
    function your_comment_reply_title( $defaults ){
    	$defaults['title_reply'] = 'Post a comment';
    
    	return $defaults;
    }
    add_filter('comment_form_defaults', 'your_comment_reply_title' );
    With kind regards.
  • Thanks again, this has fixed it!

    Now I have a slight concern. As you know I have made quite a few template file changes over the last few days, but I have just seen that there is an update to the theme available on themeforest!

    I take it that if I install this update, I would undo everything I have added? I am using the parent theme from what I understand, so do you know a suitable work around to replace everything but the updated files? Do you have some sort of change log that has the decription of what template files have been changed in your update maybe, so I can check it wont conflict with the changes I have since made?

    Whats the best work around so that I can get the updates, but still keep my changes?

    Thanks
  • AirAir
    Posts: 10,970
    Hi there:-)
    chillwiddastill said: Whats the best work around so that I can get the updates, but still keep my changes?
    http://apollo13.eu/docs/apollo13_framework_theme/#!/modification_of_theme
    chillwiddastill said: Do you have some sort of change log
    Yes, http://support.apollo13.eu/discussion/12/before-you-ask-read-this-#change_logs
    chillwiddastill said: Do you have some sort of change log that has the decription of what template files have been changed in your update
    No :-)

    So in short,
    Things added in functions.php have to be moved to same file in child theme.
    CSS changes to Custom CSS field.

    With kind regards.
  • ok thats great thanks! So in theory the best fix would be to install the child theme, then move across the functions.php, but what about the other changes that were made to other php files? As there are changes to the plugin main php file, files in advance folder, files in utilities folder etc... All CSS changes I have made have been in the custom one in the theme editor, so I can copy that across easily enough, but its the supporting content I am worried about!

    Having looked at the change log, none of the changes really apply to me so I might not update, I am just worried I will undo a lot of hard work I have put in over the last month to get the site looking the way it does!
  • Oh and I should mention that I have changed the folder name and CSS description away from "Fatmoon" to something more relevant to me. Therefore could you please advise if there is a way around this to not start a nuclear war on my site! haha
  • AirAir
    edited February 2017 Posts: 10,970
    chillwiddastill said: Therefore could you please advise if there is a way around this to not start a nuclear war on my site! haha
    These are all things you have to consider before you will make such changes. Each change in code can prevent you from safe updates, as you will lose changes as you said.
    chillwiddastill said: but what about the other changes that were made to other php files?
    Explained how to do it http://apollo13.eu/docs/apollo13_framework_theme/#!/modification_of_theme_changing_theme_functions
    chillwiddastill said: As there are changes to the plugin main php file
    Plugin probably will not be updated as it is very basic, so your changes there should be safe. In any case you always have archive of your topics here :-)
    chillwiddastill said: but its the supporting content I am worried about
    I think you have to explain me this one.
    chillwiddastill said: I am just worried I will undo a lot of hard work I have put in over the last month to get the site looking the way it does!
    You will, as whole main theme will be removed on update, so only that what is saved in Database and child theme will be safe.

    With kind regards.
    Post edited by Air on
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!