Title: Parent / Child theme problem
Last modified: August 21, 2016

---

# Parent / Child theme problem

 *  [Fwe34000](https://wordpress.org/support/users/fwe34000/)
 * (@fwe34000)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/parent-child-theme-problem/)
 * Hello everybody!
 * I use the vantage theme for my website.
 * For the blog part of this one ( [http://vitamine-design.fr/blog/](http://vitamine-design.fr/blog/))
   I wanted to translate the “Posted On” date by the french tradution “Posté le”.
 * The only solution that I found what to modify directly the vantage/inc/template-
   tags.php
 * I tried to do it in the vantage-child/inc/template-tags.php but it didn’t work.
 * I tried to modify the vantage/languages/vantage.pot but it didn’t work as well…
 * I reall y want to find a solution, because if I modify directly the template-
   tags.php in the “Vantage” folder, next update it will be lose…
 * If you can help me!
 * Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [12 years, 1 month ago](https://wordpress.org/support/topic/parent-child-theme-problem/#post-4794138)
 * Curious to know what you changed it to?
 *  Thread Starter [Fwe34000](https://wordpress.org/support/users/fwe34000/)
 * (@fwe34000)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/parent-child-theme-problem/#post-4794148)
 * As I told, I change:
 *     ```
       function vantage_posted_on() {
       	$posted_on_parts = array(
       		'on' => __('<strong>Posted on</strong> <a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>', 'vantage'),
       		'by' => __( '<span class="byline"> by <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'vantage' ),
       	);
       ```
   
 * by
 *     ```
       function vantage_posted_on() {
       	$posted_on_parts = array(
       		'on' => __('<strong>Posté le</strong> <a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>', 'vantage'),
       		'by' => __( '<span class="byline"> by <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'vantage' ),
       	);
       ```
   
 *  Thread Starter [Fwe34000](https://wordpress.org/support/users/fwe34000/)
 * (@fwe34000)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/parent-child-theme-problem/#post-4794173)
 * The solution, in the child folder, function.php file:
 *     ```
       <?php add_action('after_setup_theme','remove_fonction_parent');
       function remove_fonction_parent() {
          remove_action('hook','vantage_posted_on');
          add_action('hook','vantage_posted_on');
       }
   
       function vantage_posted_on() {
       	$posted_on_parts = array(
       		'on' => __('Posté le <a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>', 'vantage'),
       		'by' => __( '<span class="byline"> by <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'vantage' ),
       	);
       	$posted_on_parts = apply_filters('vantage_post_on_parts', $posted_on_parts);
   
       	$posted_on = sprintf( implode(' ', $posted_on_parts),
       		esc_url( get_permalink() ),
       		esc_attr( get_the_time() ),
       		esc_attr( get_the_date( 'c' ) ),
       		apply_filters('vantage_post_on_date', esc_html( get_the_date() )),
       		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
       		esc_attr( sprintf( __( 'View all posts by %s', 'vantage' ), get_the_author() ) ),
       		get_the_author()
       	);
       	echo apply_filters('vantage_posted_on', $posted_on);
       }
   
       ?>
       ```
   
 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [12 years, 1 month ago](https://wordpress.org/support/topic/parent-child-theme-problem/#post-4794200)
 * You can also use a filter in your child theme.
 *     ```
       add_filter( 'vantage_post_on_parts', 'child_parts' );
       function child_parts(){
       	return array(
       		'<strong>Posté le</strong> <a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
       		'<span class="byline"> by <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>'
       		);
       }
       ```
   
 * Not sure what translation tool you are using but in the most recent version (
   1.1.11 ) [that phrase is in line 1468](https://themes.trac.wordpress.org/browser/vantage/1.1.11/languages/vantage.pot#L1468)
   of the POT file.
 * That would be one way I can think of changing it without losing your edits. 🙂
 *  Thread Starter [Fwe34000](https://wordpress.org/support/users/fwe34000/)
 * (@fwe34000)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/parent-child-theme-problem/#post-4794201)
 * Hello Jose,
 * So if I undo the solution I proposed in my child functions.php file and put yours
   it should work?
 * Moreover, if I only copy the .pot file in my child folder and change “Posted 
   on” by “Posté le” it should work directly without the modifications in the function
   file?
 * Thanks for your answer!
 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [12 years, 1 month ago](https://wordpress.org/support/topic/parent-child-theme-problem/#post-4794203)
 * Yes, it should work. I tested it prior to posting it. Make sure that you are 
   returning the array otherwise you will get an error.
 * As for the POT file in the child theme I can’t say for sure; I’m not too familiar
   with how it is handled. I have an idea but I would feel bad if something went
   wrong.
 *  Thread Starter [Fwe34000](https://wordpress.org/support/users/fwe34000/)
 * (@fwe34000)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/parent-child-theme-problem/#post-4794226)
 * Hello Jose!
 * I tried your solution and it worked well!
 * But I tried to use the “POT File” solution:
 * -I downloaded in “Parent theme>languages>vantage.pot”
    -Opened it in POEDIT, 
   saved it in PO and MO files, did the translation in my PO file, saved him and
   uploaded both PO and MO files in my “Child Theme>languages>” folder: it didn’t
   work!
 * BUT I uploaded them in my “Parent theme>languages>” folder and it worked!
 * Is there a solution to open them from the Child folder? When my them will be 
   uploaded will y transation be erase?
 * Thx!
 * Fred
 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [12 years, 1 month ago](https://wordpress.org/support/topic/parent-child-theme-problem/#post-4794261)
 * Part of the reason is when the language file is being loaded the function `load_theme_textdomain`
   is used and most parent themes will use: `get_template_directory` in favor of`
   get_stylesheet_directory`
 * One solution would be calling `load_theme_textdomain` in your functions file 
   and using the `get_stylesheet_directory` but then you may run into trouble with
   parent/child text domain issues. I’ve yet to experiment with that.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Parent / Child theme problem’ is closed to new replies.

## Tags

 * [child](https://wordpress.org/support/topic-tag/child/)
 * [parent](https://wordpress.org/support/topic-tag/parent/)

 * 8 replies
 * 2 participants
 * Last reply from: [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/parent-child-theme-problem/#post-4794261)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
