1
votes

I am using Woffice theme in wordpress and i activated the woffice child theme and now i wanted to override parent theme files. This is parent theme folder directory

/wp-content/themes/woffice/buddypress/members/index.php

and i want to make changes in index.php in child theme i pasted folder in like this to override

/wp-content/themes/woffice-child-theme/buddypress/members/index.php

but it can't override. Please help me if there is any other way for doing this.

2

2 Answers

2
votes

Wordpress child theme is supported to override only templates. In Wordpress, a theme consists of a bunch of PHP files which are used as templates. You can find a list of those files in the Template Hierarchy.

https://developer.wordpress.org/themes/basics/template-hierarchy/

0
votes

the whole story of the child theme is:

https://codex.wordpress.org/Child_Themes

In summary, the child theme must invoke the parent

<?php
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );

    }
    ?>

in its function.php

and have new PHP template files to overwrite the template files of the parent (both must have the same name). If exists a template file in the child then WP is going to use this.

But also in the other hand, there are starter themes like the below, that provide the basis for devlopment:

https://underscores.me/ (created by Wordpress peolpe)

http://jointswp.com/ (Foundation framework)

https://understrap.com/ (Bootstrap 4)