neve icon indicating copy to clipboard operation
neve copied to clipboard

Overriding template_parts.php in a child theme

Open stefan-cotitosu opened this issue 4 years ago • 4 comments

Description:

The following file neve/inc/views/template_parts.php can't be overwritten in a child theme.

User story:

A customer wants users to search for media files instead of posts on his website and he changed the following line in the theme(file mentioned above)

$thumb = get_the_post_thumbnail_url(); to $thumb = wp_get_attachment_thumb_url( $attachment_id );

Alternatives:

N/A

Reference

https://secure.helpscout.net/conversation/1518609437/279392/

stefan-cotitosu avatar May 20 '21 08:05 stefan-cotitosu

+1 https://secure.helpscout.net/conversation/1629561633/291992/

This customer is not happy with the heading tag for the post title being changed on the Blog page from H2 to H3 in Neve 3.0 skin(details here). She wanted to override it in a child theme, the same file neve/inc/views/template_parts.php but it doesn't work.

This is also a problem because, in our documentation about the Neve child theme, we advise users to copy the views folder in the child theme and edit the desired file, however, this approach doesn't work. Hopefully, we can find a solution, otherwise, at least the doc needs to be updated.

stefan-cotitosu avatar Sep 16 '21 13:09 stefan-cotitosu

@stefan-cotitosu The doc applies to the views folder from the root of the theme, not the one inside the /inc directory.

abaicus avatar Dec 21 '21 18:12 abaicus

Thank you for the clarification, I'll pay more attention next time 😀

stefan-cotitosu avatar Dec 29 '21 11:12 stefan-cotitosu

Is it possible to add filters on the following lines?

https://github.com/Codeinwp/neve/blob/90e69233ca4ec4fefe826c86f1f4a1fb1f60d42d/inc/views/partials/post_meta.php#L276

https://github.com/Codeinwp/neve/blob/90e69233ca4ec4fefe826c86f1f4a1fb1f60d42d/inc/views/partials/post_meta.php#L286

We got a request on wordpress.org about this - https://wordpress.org/support/topic/child-theme-issue-18/. The user wants to change the link of the date and author.

stefan-cotitosu avatar Feb 18 '22 13:02 stefan-cotitosu