• Hi Ben,

    When users enter comments (Period Pro), they get to enter their name, email, website, and of course the comment itself. I’d like to collect all of that, but when rendering the comment, I don’t want the default behavior of Period, which is to link the name to the website (if entered).

    I notice that for the comments section, you already customize the rendering with ct_period_customize_comments(...) where you have the appropriate call to render the linked name: <span class="author-name"><?php comment_author_link(); ?></span>

    Since that is in the functions.php of the theme, what’s the best way for me to customize it in my child theme? Essentially, I want to change that one line to: <span class="author-name"><?php comment_author(); ?></span>

    Thanks much!
    Dan

    • This topic was modified 2 years, 7 months ago by turbodb.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Ben Sibley

    (@bensibley)

    Hi Dan,

    Thanks for using Period!

    You can copy the entire ct_period_customize_comments() function from Period into your child theme’s functions.php file and then make whatever edits you’d like to make there.

    This is possible because the child theme’s functions.php file is always loaded before the parent’s, and Period checks if the function exists before defining it:

    if (! function_exists(('ct_period_customize_comments')))

    Since your child theme has already created this function, that if statement evaluates to false and your version is used instead.

    Thread Starter turbodb

    (@turbodb)

    Thanks Ben, I was wondering if that was the way to do it; I probably should have just tried it!

    Cheers,
    Dan

    Theme Author Ben Sibley

    (@bensibley)

    All good. Glad I could help out ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customizing comment author’ is closed to new replies.