• Hello, I’ve been trying to override the members-loop.php template but it just won’t work. I can’t make a change unless I modify the core plugin files. This shouldn’t be the case…can you help? Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support john

    (@johnweru)

    Hi there,

    Thanks for reaching out to us.

    In regards to your query here, you can implement template files override in child theme by placing the files that you wish to override under a “buddybuilder” folder that you can create within your child theme. Once this is done, you can then use the template_include filter in the functions.php file of your child theme to filter the path. Below is an example code:

    add_filter( 'template_include', 'members_loop_custom', 99 );
    
    function members_loop_custom( $template ) {
    
    	if ( is_page( 'members' )  ) {
    		$new_template = locate_template( array( 'buddybuilder/members-loop.php' ) );
    		if ( '' != $new_template ) {
    			return $new_template ;
    		}
    	}
    
    	return $template;
    }

    I hope this information helps.

    Kind Regards

    Thread Starter shemakeswebsites

    (@shemakeswebsites)

    Thank you for your response but doing this breaks the page. Can you advise?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Template override’ is closed to new replies.