Post Author tag

This topic contains 8 replies, has 3 voices, and was last updated by  Joy 8 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #190719

    Joy
    Buyer
    Post count: 1076

    Hello, how do I properly change the Post Author tag that shows up when an author leaves a comment on their own listing?

    I found this in the comment_functions.php file

    
    
    // If current post author is also comment author, make it known visually.
                                ($comment->user_id === $post->post_author) ? '<span>' . __('Post author', 'geodirectory') . '</span>' : ''
                            );

    I have updated the ‘Post author’ name and it shows up as it should. But when I run my debug, I am getting these notices:

    [14-May-2016 08:59:05 UTC] PHP Notice: Trying to get property of non-object in /home/luckywel/public_html/wp-content/themes/kleo-child/functions.php on line 615

    [14-May-2016 08:59:05 UTC] PHP Notice: Undefined variable: post in /home/luckywel/public_html/wp-content/themes/kleo-child/functions.php on line 615

    [14-May-2016 08:59:05 UTC] PHP Notice: Trying to get property of non-object in /home/luckywel/public_html/wp-content/themes/kleo-child/functions.php on line 615

    #190842

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    what is on line 615 of functions.php?

    Stiofan

    #191157

    Joy
    Buyer
    Post count: 1076

    Same thing, I just updated the ‘Post Author’ tag like I previously mentioned:

    
    
    // If current post author is also comment author, make it known visually.
                                ($comment->user_id === $post->post_author) ? '<span>' . __('Listing Owner', 'geodirectory') . '</span>' : ''
                            );
    #192215

    Paolo
    Site Admin
    Post count: 31206

    Hi,
    you shouldn’t be changing text strings within the code. That is wrong procedure.

    You must use translation files: https://wpgeodirectory.com/docs/translate-core/

    Thanks

    #192581

    Joy
    Buyer
    Post count: 1076

    I have added the code to my child theme file, so it’s not within the code and will not be overwritten upon update.

    Can you tell me the proper way to change the “Post Author” tag please?

    #192974

    Paolo
    Site Admin
    Post count: 31206

    Via translation file.

    If you think about it, translating or rephrasing is the same thing.

    Please read: https://wpgeodirectory.com/docs/translate-core/

    Thanks

    #193035

    Joy
    Buyer
    Post count: 1076

    So it cannot be done through my child functions file? That would be ideal so that I may keep all of my code in the same place.

    Thank you.

    #193038

    Paolo
    Site Admin
    Post count: 31206

    No it can’t be done via functions, because it’s not a code change, it text and it can only be done via translation file.

    Thanks

    #193242

    Joy
    Buyer
    Post count: 1076

    Okay I understand.

    Thank you.

Viewing 9 posts - 1 through 9 (of 9 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount