• Hello.
    I have created a child theme and was trying to modify the file post-meta.php which I have copied to the same directory of my child theme.
    But the changes didn’t take any effect. Could you help me with this, please?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Leo

    (@leohsiang)

    Hi there,

    WordPress only allows files to be overwritten in the top-level folder.

    What are you trying to achieve? There is a generally a filter we can use.

    Thread Starter Pablejacio

    (@pablejacio)

    Ok. No problem, thank you.

    Leo

    (@leohsiang)

    No problem ??

    What if there is no action/filter? I want to change how post meta displays so overriding post-meta.php file which is inside inc/structure/ folder. But it doesn’t work, I am not sure if WP allows only top level files to be overridden so please provide if any alternate step exists.

    Hi there,

    you would write a replacement Function and add it your child themes functions.php

    For example:

    the post-meta.php first function call is the generate_content_nav.
    Thanks to this condition if ( ! function_exists( 'generate_content_nav' ) ) { it will not run if a replacement generate_content_nav exists in the child theme.

    • This reply was modified 4 years, 8 months ago by David.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Child them: post-meta.php problem’ is closed to new replies.