[Resolved] Little change in the function generate_do_post_meta_item

Home Forums Support Little change in the function generate_do_post_meta_item

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #1394882
    Raquel Requena López

    Could you put a condition in the function of the file /themes/generatepress/inc/structure/post-meta.php function generate_do_post_meta_item?
    if ( ! function_exists( ‘generate_do_post_meta_item’ ) {
    function generate_do_post_meta_item( $item ) {
    I need to make a theme child and have that function and every time I update the module I get an error and have to add it in the parent theme.
    I have seen that in the file /themes/generatepress/inc/structure/comments.php function generate_comment have done it.
    if ( ! function_exists( ‘generate_comment’ ) ) {
    * Template for comments and pingbacks
    * Used as a callback by wp_list_comments() for displaying the comments.
    function generate_comment( $comment, $args, $depth ) {

    Customer Support

    Hi there,

    what changes are you trying to make to the post-meta.php?
    As we can probably make those changes with Hooks.

    Let us know

    Raquel Requena López

    I have the function in my functions.php file of my child theme and the problem is that it runs before the parent theme.
    When it will call the parent function it gives an error because it already exists.
    The changes are:
    – Hide the date of the post if it’s been more than 9 months
    – Remove links to the author
    However, if you were to put:
    if ( ! function_exists( ‘generate_do_post_meta_item’ ) {
    Before the show, I would solve my problem and it doesn’t disturb the programming at all.
    Thank you

    Customer Support

    Instead of overwriting the post-meta function we could use filters to change the content.

    First the Remove Author Links:


    For the post date you could use this filter:


    Raquel Requena López

    Very interesting these links, I didn’t know that.
    Thanks for the help, I close the topic

    Customer Support

    99% of the GP Theme controlled elements have a Filter Hook 🙂

    Glad to be of help.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.