php - 更改文本以阅读更多内容和评论
问题描述
我有波兰语网站,这就是我想要翻译所有元素的原因。
去做:
- 翻译按钮 阅读更多
- 翻译“无评论”(何时发布 0 条评论,显示“无评论”但当我至少有一条时,我有正确的波兰语信息)
我的wordpress模板:萨沃纳
我不知道在哪里可以找到文件中的元素来更改它。我从源浏览器上传带有信息的图像:
这是我的 post-content.php
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if ( have_posts() ) :
// Loop Start
while ( have_posts() ) :
the_post();
?>
<div class="post-media">
<?php the_post_thumbnail('savona-full-thumbnail'); ?>
</div>
<header class="post-header">
<?php
$category_list = get_the_category_list( ', ' );
if ( savona_options( 'single_page_show_categories' ) === true && $category_list ) {
echo '<div class="post-categories">' . ent2ncr($category_list) . ' </div>';
}
?>
<h1 class="post-title"><?php the_title(); ?></h1>
<div class="post-meta clear-fix">
<?php if ( savona_options( 'single_page_show_date' ) === true ) : ?>
<span class="post-date"><?php the_time( get_option( 'date_format' ) ); ?></span>
<?php endif; ?>
</div>
</header>
<div class="post-content">
<?php
// The Post Content
the_content('');
// Post Pagination
$defaults = array(
'before' => '<p class="single-pagination">'. esc_html__( 'Pages:', 'savona' ),
'after' => '</p>'
);
wp_link_pages( $defaults );
?>
</div>
<footer class="post-footer">
<?php if ( savona_options( 'single_page_show_author' ) === true ) : ?>
<span class="post-author"><?php esc_html_e( 'By', 'savona' ); ?> <?php the_author_posts_link(); ?></span>
<?php endif; ?>
<?php
if ( savona_options( 'single_page_show_comments' ) === true && comments_open() ) {
comments_popup_link( esc_html__( 'No Comments', 'savona' ), esc_html__( '1 Comment', 'savona' ), '% '. esc_html__( 'Comments', 'savona' ), 'post-comments');
}
?>
</footer>
<?php
endwhile; // Loop End
endif; // have_posts()
?>
</article>
解决方案
尽管这可能不是正确的方法,但您可以像下面这样轻松更改。
- “阅读更多”文本 - 替换
'blog_page_more_text' => 'Read More',
为'blog_page_more_text' => 'Czytaj dalej',
“inc/customizer/customizer-defaults.php”中的内容。 - 无评论文本 - 将'templates/grid/blog-grid.php' 和 'templates/single/post-content.php' 中的出现
'No Comments'
替换为。'Brak komentarzy'
推荐阅读
- amazon-quicksight - QuickSight 中的 Sumover
- css - CSS - 如何将文本组成另一个文本和向下的按钮
- sql - 我怎样才能将另一个 SQL COUNT 嵌套到其中?
- angular6 - Angular6:动态实例化(使用新的)类,包括依赖注入
- mysql - MySQL 跨多个索引搜索
- c# - Linux下C#,Process.Start()出现“No such file or directory”异常
- sql - 以高做大
- asp.net - 在 ASP.NET MVC5 视图中显示单元测试结果
- python - Tensorflow TocoConverter 给出 toco_from_protos 错误
- java - 如何为java进程创建PID文件