ThemeShaper Forums » Thematic

[closed]

Child Theme functions.php conflict with localization

(3 posts)
  • Started 9 years ago by pilkster
  • Latest reply from Chris
  • This topic is not resolved
  1. pilkster
    Member

    Hey there,

    I'm currently customizing my first WP theme. I chose Thematic as my framework, and I'm creating a Child Theme for it.
    I wanted to make a custom function, which would remove some info from each post (author, time of publishing, so on).
    I managed to do it, but there's a conflict with my localized Thematic theme.


    function childtheme_postfooter() {
    global $post;

    if (is_single()) { ?>
    <div class="entry-utility">
    <?php the_time('d. m. Y') ?>

    <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) : // Comments and trackbacks open ?>
    <?php printf(__('Post a comment or leave a trackback: Trackback URL.', 'thematic'), get_trackback_url()) ?>
    <?php elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) : // Only trackbacks open ?>
    <?php printf(__('Comments are closed, but you can leave a trackback: Trackback URL.', 'thematic'), get_trackback_url()) ?>
    <?php elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) : // Only comments open ?>
    <?php printf(__('Trackbacks are closed, but you can post a comment.', 'thematic')) ?>
    <?php elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) : // Comments and trackbacks closed ?>
    <?php _e('Both comments and trackbacks are currently closed.') ?>
    <?php endif; ?>
    <?php edit_post_link(__('Edit', 'thematic'), "\n\t\t\t\t\t<span class=\"edit-link\">", "</span>"); ?>

    </div><!-- .entry-utility -->
    <?php } else { ?>
    <?php if ( $post->post_type == 'post' ) { // Hide entry utility on searches ?>
    <div class="entry-utility">
    <span class="comments-link"><?php comments_popup_link(__('Leave a comment', 'thematic'), __('1 Comment', 'thematic'), __('% Comments', 'thematic')) ?></span>
    <?php edit_post_link(__('Edit', 'thematic'), "\t\t\t\t\t<span class=\"meta-sep\">|</span>\n<span class=\"edit-link\">", "</span>\t\t\t\t\t"); ?>
    </div><!-- .entry-utility -->
    <?php } ?>
    <?php }
    }
    add_filter ('thematic_postfooter', 'childtheme_postfooter');

    So for example, the function overrides my original, mother tongue version of the following notice "Both comments and trackbacks are currently closed".

    Posted 9 years ago #
  2. pilkster
    Member

    Hate to double post, but I noticed that I didn't explain what the problem was.
    So here it is:
    How can I customize childtheme_postfooter() in such a way, that it still uses my .po file?

    Posted 9 years ago #
  3. Sorry .. if you change a text that is included in the .po then it won't translate any longer.

    You would need to create your own text domain for these changes.

    Chris

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.