ThemeShaper Forums » Thematic

[closed]

Rename fields in comments entry utility

(11 posts)
  • Started 13 years ago by kgoodman
  • Latest reply from paaljoachim
  • This topic is resolved

Tags:

  1. kgoodman
    Member

    Hi -

    I want to change the display of the "Post a comment" link to "Share your story" *ONLY* for posts in a specific category. Using the comments functionality for specific posts to allow users to feel like they are sharing "stories" instead of posting a comment.

    I feel like it would come from comments.php and then I would apply a filter hook in my child theme functions.php????

    Been thru forums and codex trying to figure out where it is pulled.

    I would be most grateful for help. Or even just to tell me this is impossible.

    Thanks!
    Kyndra

    I am using Thematic Feature Site

    Posted 13 years ago #
  2. Hi Kyndra,

    it is possible. I will publish some examples later this evening.

    Chris
    - missing a PHP editor for the iPhone

    Posted 13 years ago #
  3. You need to upgrade Thematic to v0.9.6.1 and add this code to your child theme's functions.php:

    function my_postcomment_text($text) {
    	if (in_category('Uncategorized')) {
    		return 'Share your story';
    	} else {
    		return $text;
    	}
    }
    add_filter('thematic_postcomment_text', 'my_postcomment_text');

    Change the in_category('Uncategorized') according to your needs.

    These are the filters for the comments related text:

    - The standard text 'One Comment' can be filtered using thematic_singlecomment_text.
    - The standard text 'n Comments' can be filtered using thematic_multiplecomments_text.
    - The standard text 'Post a Comment' can be filtered using thematic_postcomment_text.
    - The standard text 'Post a Reply to %s' can be filtered using thematic_postreply_text.
    - The standard text 'Comment' for the text box can be filtered using thematic_commentbox_text.
    - The standard text 'Post Comment' for the send button can be filtered using thematic_commentbutton_text.

    Chris

    Posted 13 years ago #
  4. kgoodman
    Member

    Chris -

    Thanks so much! I really really really appreciate your help.

    All the best,
    Kyndra

    Posted 13 years ago #
  5. Hi Chris,

    I have been trying to customise a specific page using your example above.

    function my_postcomment_text($text) {
    if (is_page('2')) {
    return 'Share your story';
    } else {
    return $text;
    }
    }
    add_filter('thematic_postcomment_text', 'my_postcomment_text');

    However, how would I rearrange comments for this page so that the form is at the top?

    Cheers

    Dylan

    Posted 13 years ago #
  6. paaljoachim
    Member

    A quick question about the above example:

    function my_postcomment_text($text) {
    if (in_category('Uncategorized')) {
    return 'Share your story';
    } else {
    return $text;
    }
    }
    add_filter('thematic_postcomment_text', 'my_postcomment_text');

    --- How would I write this function without the if and else?---
    Just a straight forward wanting to change the name of the commentbutton_text.

    Thanks!

    Posted 12 years ago #

  7. function my_postcomment_text($text) {

    return 'Share your story';

    }
    add_filter('thematic_postcomment_text', 'my_postcomment_text');

    Should work. :)

    Posted 12 years ago #
  8. paaljoachim
    Member

    Smooth as butter...:)

    Thanks!

    While I am here....anyone got any other tips/advice on using filters?

    Posted 12 years ago #
  9. paaljoachim
    Member

    I have a few more questions about posts and thematic.

    ** I included the Norwegian language file but only the backend changed nothing on the frontend. How do I change the frontend to Norwegian? I have changed the thematic_commentbox_text and thematic_commentbutton_text to Norwegian words, and am thinking of continuing to do so with other post/comment words. But I am puzzled on a few things on a post page:

    http://spirituellfilm.no/wordpress/lang/no/healing-miracles-mysteries-and-john-of-god

    "This entry was posted in 2011, Filmer. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL. Edit"

    ** How would I go about changing the above line? There is too much info on it that I do not need. **

    ** On the same page further down there is a mention of another post. Either an earlier post or later post. How would I go about adjusting this line? **

    ** Can a person who posts a reply edit or delete their own reply? **

    On this blog page:
    http://spirituellfilm.no/wordpress/blogg

    Why does it sometimes come up as http://spirituellfilm.no/wordpress/lang/no/blogg
    and sometimes with the lang/en

    I would like the page to keep it's original wordpress/blogg link and not the extra stuff behind it.

    Thank you very much for your reply...:)

    Have a great day!

    Posted 12 years ago #
  10. middlesister
    Member

    When you talk about adjusting these lines, if you by that mean translating well thematic actually has a norwegian translation. The file locale is nb_NO which i guess is bokmål. If you have specified nb_NO as your locale in wp-config.php, it should be used.

    The fact that you sometimes have URLs with lang/en and lang/no seems to indicate you are using some kind of multilingual plugin. Are you and what plugin are you using in that case?

    If you want to change the lines themselves (and not merely translate) that would be done with hooks and filters.

    It would be better to start a new thread with this question since this topic is already marked as resolved.

    Posted 12 years ago #
  11. paaljoachim
    Member

    Hello middlesister...:)

    At first I found the plugin Xlanguage and activated it, but there was no change. So I adjusted the wp-config.php adding in the nb_NO bokmål language. Suddenly the backend changed but nothing on the frontend. I have now disactivated the XLanguage plugin. I'll later see if anything has changed...... later came quickly....:) Disactivating XLanguage made the Norwegian language come through on the frontend.....:) Yayyyy!!! Nice!!! Great!!!...:))

    Seems all my problems became solved. I am still curious about learning more about hooks and filters as it seems like the best way to make adjustments to a theme. I'll make other posts where I will have the chance to learn more about them.

    Thanks sis...:)

    Paal Joachim

    Posted 12 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.