Cześć,
robię stronkę WP i korzystam z wtyczki polylang - tworzy wersje językowe, ale niestety nie tłumaczy wszystkiego...
1. button do rozwijania posta
2. footer w postach - to może później.
kod do pkt 1.
chodzi o zmianę wyrazu 'More' w końcówce kodu załączonego poniżej.
Jako, że dopiero zaczynam się uczyć php to nie wiem jak to ugryźć - w źródle strony, w zależności od języka tłumaczenia mam <html lang="en-GB">
lub <html lang="de-DE"> myślałem, że mógłbym dopisać jakoś if-a, który w zależności o tego 'lang' zmieniałby wyraz na 'Mehr' - da sie?
the_excerpt();
echo '<div style="clear:both"></div><a href="' . esc_url( get_permalink() ) . '" class="factorian-btn">'.esc_html__('More', 'factorian-crazycafe').'</a>';
<?php
/**
* Template part for displaying posts.
*
* @link <a href="https://codex.wordpress.org/Template_Hierarchy" target="_blank">https://codex.wordpress.org/Template_Hierarchy</a>
*
* @package factorian_Crazycafe
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php if(get_post_type() == 'work') :
if(get_post_meta($post->ID, 'factorian_work_meta', true)) {
$work_meta = get_post_meta($post->ID, 'factorian_work_meta', true);
} else {
}
$get_preview_images_array = $work_meta['gallery'];
$get_preview_images = explode( ',', $get_preview_images_array ); $preview_no = 0;
if(empty($get_preview_images)){ $get_preview_images = array(); }
$total_preview = count($get_preview_images);
echo '<div class="row work-previews total-work-preview-'.$total_preview.'">'; // Loop through them and output an image
foreach ( $get_preview_images as $attachment_id ) {
$preview_no++;
if($total_preview == 1) {
$preview_column = 'col-md-12';
$preview_thumbnail_source = wp_get_attachment_image_src($attachment_id, 'full');
} elseif($total_preview == 2) {
$preview_column = 'col-md-6';
} elseif($total_preview == 4) {
$preview_column = 'col-md-3';
$preview_thumbnail_source = wp_get_attachment_image_src($attachment_id, 'medium');
} else {
$preview_column = 'col-md-4';
$preview_thumbnail_source = wp_get_attachment_image_src($attachment_id, 'large');
};
$preview_link_source = wp_get_attachment_image_src($attachment_id, 'large');
$preview_image_meta = wp_prepare_attachment_for_js($attachment_id);
$preview_image_array = wp_get_attachment_image_src($attachment_id, 'large');
<a title="'.esc_html($preview_image_meta['title']).'" title="" href="'.esc_url($preview_link_source[0]).'" class="'.esc_attr($preview_column).' single-work-preview-item image-popup-link">
<div class="work-thumbnail-wrap">
<span class="work-thumb-loading"><i class="fa fa-cog fa-spin"></i> '.esc_html__('thumbnail loading', 'factorian-crazycafe').'</span>
<span class="work-zoom-icon"><i class="fa fa-search"></i></span>
<div style="background-image:url('.esc_url($preview_image_array[0]).')" class="single-work-preview single-work-preview-'.esc_attr($preview_no).'"></div>
</div>
</a>
';
}
?>
<?php else : ?>
<?php if(has_post_thumbnail()) : ?>
<div class="factorian-post-featured-content">
<?php the_post_thumbnail('factorian-crazycafe-thumb'); ?>
</div>
<?php endif; ?>
<?php if (( 'post' === get_post_type() ) && !is_singular() ) : ?>
<h2><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
<?php endif; ?>
<?php endif; ?>
</header><!-- .entry-header -->
<div class="entry-content">
<?php
if(is_single()) {
/* translators: %s: Name of current post. */
wp_kses
( __
( 'Continue reading %s <span class="meta-nav">→</span>', 'factorian-crazycafe' ), array( 'span' => array( 'class' => array() ) ) ), the_title( '<span class="screen-reader-text">"', '"</span>', false )
) );
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'factorian-crazycafe' ),
'after' => '</div>',
) );
} else {
the_excerpt();
echo '<div style="clear:both"></div><a href="' . esc_url
( get_permalink
() ) . '" class="factorian-btn">'.esc_html__
('More', 'factorian-crazycafe').'</a>'; }
?>
</div><!-- .entry-content -->
<footer class="entry-footer">
<?php if('post' === get_post_type()) {factorian_crazycafe_posted_on();} factorian_crazycafe_entry_footer(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->