Change function to use with filters and change the name.
This commit is contained in:
parent
30901a33e9
commit
6bf39376a4
|
@ -20,6 +20,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.blog-content{
|
.blog-content{
|
||||||
|
font-size: 0.75rem;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #898d8f;
|
||||||
&.blog-flex{
|
&.blog-flex{
|
||||||
@media screen {
|
@media screen {
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
|
@ -38,6 +41,7 @@
|
||||||
}
|
}
|
||||||
.text-black{
|
.text-black{
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
time{
|
time{
|
||||||
font: {
|
font: {
|
||||||
|
|
|
@ -57,14 +57,25 @@ add_filter( 'comment_text', 'wrap_Comment', 99);
|
||||||
/**
|
/**
|
||||||
* Display date of post.
|
* Display date of post.
|
||||||
*/
|
*/
|
||||||
function tainacan_post_date() {
|
function tainacan_meta_date_author($echo = true) {
|
||||||
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
|
$time = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
|
||||||
|
|
||||||
$time_string = sprintf( $time_string,
|
$time_string = sprintf( $time,
|
||||||
esc_attr( get_the_date( 'c' ) ),
|
esc_attr( get_the_date( 'c' ) ),
|
||||||
get_the_date()
|
get_the_date()
|
||||||
);
|
);
|
||||||
echo $time_string;
|
|
||||||
|
$string = $time_string;
|
||||||
|
$string .= __(' by ', 'tainacan-theme');
|
||||||
|
$string .= get_the_author_posts_link();
|
||||||
|
|
||||||
|
$string = apply_filters('tainacan-meta-date-author', $string);
|
||||||
|
|
||||||
|
if ($echo) {
|
||||||
|
echo $string;
|
||||||
|
} else {
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// define the cancel_comment_reply_link callback
|
// define the cancel_comment_reply_link callback
|
||||||
|
|
|
@ -22,8 +22,7 @@
|
||||||
<article role="article" id="post_<?php the_ID()?>" <?php post_class()?>>
|
<article role="article" id="post_<?php the_ID()?>" <?php post_class()?>>
|
||||||
<header class="mb-4">
|
<header class="mb-4">
|
||||||
<div class="header-meta text-muted mb-5">
|
<div class="header-meta text-muted mb-5">
|
||||||
<span class="time"><?php tainacan_post_date(); ?></span>
|
<span class="time"><?php tainacan_meta_date_author(); ?></span>
|
||||||
<?php printf(__('by %s', 'tainacan-theme'), get_the_author_posts_link()); ?>
|
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<?php if (tainacan_has_document()): ?>
|
<?php if (tainacan_has_document()): ?>
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
<a href="<?php the_permalink(); ?>" class="font-weight-bold"><?php the_title(); ?></a>
|
<a href="<?php the_permalink(); ?>" class="font-weight-bold"><?php the_title(); ?></a>
|
||||||
</h3>
|
</h3>
|
||||||
<?php echo '<p class="text-black">'.wp_trim_words( get_the_excerpt(), 28, '...').'</p>'; ?>
|
<?php echo '<p class="text-black">'.wp_trim_words( get_the_excerpt(), 28, '...').'</p>'; ?>
|
||||||
<?php tainacan_post_date(); ?>
|
<?php tainacan_meta_date_author(); ?>
|
||||||
<span style="font-size: 0.75rem; font-weight: 400; color: #898d8f;"> <?php printf(__('by %s', 'tainacan-theme'), get_the_author_posts_link()); ?></span>
|
|
||||||
<a href="<?php the_permalink(); ?>" class="readmore float-right screen-reader-text"><?php _e('Read more...', 'tainacan-theme'); ?></a>
|
<a href="<?php the_permalink(); ?>" class="readmore float-right screen-reader-text"><?php _e('Read more...', 'tainacan-theme'); ?></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -21,10 +21,6 @@
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<p style="font-style: italic;"><?php _e('Description not informed'); ?></p>
|
<p style="font-style: italic;"><?php _e('Description not informed'); ?></p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<!-- <p>
|
|
||||||
<?php //_e('Create by: ');?> <?php //the_author(); ?><br>
|
|
||||||
<?php //_e('Date: ');?> <?php //tainacan_post_date(); ?>
|
|
||||||
</p> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<header class="mb-4">
|
<header class="mb-4">
|
||||||
<div class="header-meta text-muted mb-5 d-flex">
|
<div class="header-meta text-muted mb-5 d-flex">
|
||||||
<?php if(!is_singular('page')) { ?>
|
<?php if(!is_singular('page')) { ?>
|
||||||
<?php tainacan_post_date(); ?> <?php printf(__('by %s', 'tainacan-theme'), get_the_author_posts_link()); ?>
|
<?php tainacan_meta_date_author(); ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<div class="btn-group ml-auto" role="group">
|
<div class="btn-group ml-auto" role="group">
|
||||||
<?php if ( true == get_theme_mod( 'facebook_share', true ) ) : ?>
|
<?php if ( true == get_theme_mod( 'facebook_share', true ) ) : ?>
|
||||||
|
|
Loading…
Reference in New Issue