• I have an issue which is most likely caused my lack of coding knowledge.

    My parent theme include the following function within framework/register_public.php.

    function simple_breadcrumb_case($der_post){
    		$markup = $this->options['before'].$this->options['after'];
    
    		if(is_category()){
    			$category = get_the_category();
    			$i = $category[0]->cat_ID;
    			$parent = $category[0]-> category_parent;
    			if($parent > 0 && $category[0]->cat_name == single_cat_title("", false)){
    				echo get_category_parents($parent, TRUE, $markup, FALSE);
    			}
    		return __("Archive for Category: ",'dt_themes').single_cat_title('',FALSE);
    		}
    	}
    }

    I want to change the return at the end to:

    return __(" ",'dt_themes').single_cat_title('',FALSE);

    but obviously I want to do this in a child theme so future update aren’t overwritten.

    I have duplicated the file into the same path as my childtheme and altered it. That didn’t work.

    Then I read that you have to declare a new function in your child themes function.php, so I created:

    function childtheme_simple_breadcrumb_case(){
    
    }

    Then change the instance of simple_breadcrumb_case in the child theme to the new function childtheme_simple_breadcrumb_case. Whilst altering the return(); to include the changes I want.

    This is where I get stuck I am not 100% how I overwrite the parents themes functions.

  • The topic ‘Overwriting Parenst Theme Functions’ is closed to new replies.