Hi folks:
requesting option to have the “time” shown in addition to date of publication next to author byline on the post pages.
Sadly ran into issue where the previous “fix” I have also suggested for adding time stamp to the time on the WP admin settings page, unfortunately “prints” that time stamp on the “by day” archives templates and couple other “date” based things where it should not.
Ideally the post “when published” option, common on news sites, SHOULD BE a combination of pulling BOTH the “date” setting + the “time” setting.
Presumably I can manually add this to the post template each update, but just ran into issue with some things where the “accepted” fix the past year on this topic is essentially NOT the best way to address this.
so, ideally we’d need something like
<?php echo $td_mod_single->get_date(false);?> <?php echo $td_mod_single->get_time(false);?>
Hi, Chris
Have you added “time” with inline date of your posts? I really need that and was about to create a topic for it. Luckily i found your post before i create another one.
if you did, please share us 🙂
Hi,
have not done this yet; been too busy; next thing on my to do list is actually working with Radu on testing a “shim” for our server to not use Visual Composer with Newsmag 1.7.1B, which crashed one of our sites and we had to remove. That’s the big deal right this moment.
For time …
likely going to try adding this to the single post template we’re using, after the date grab and before views eyeball:
<?php echo get_the_time(); ?>
ref
https://codex.wordpress.org/Function_Reference/get_the_time
@Chris S
Thank you for being very helpful and nice to others just like an owner of theme 🙂
Thanks again and goodluck
Okay, this does work.
I opened up single_template_2.php
and on/about line 30
added the time as so:
<?php echo $td_mod_single->get_date(false);?> <?php echo get_the_time(); ?>
Works perfectly.
Output on the post as (example):
By Terry Windall - May 5, 2015 12:47:18 -0400 EDT
Hi,
You can change the date format from Settings – http://screencast.com/t/p3JTktxKI
Also for modified date please try this solution – https://forum.tagdiv.com/topic/post-page-edit-help/#post-32402
Thanks!
Hi Alin,
oh, wordpress as changed the date format. Now its all fine.
Also modified date work.
Thanks for your help.
Just one more question about single template 6. Is it possible to show photocredit and description on the image (right corner) like in single template 5.
Hi,
The caption for that post style not displayed because the featured image is not loaded default via WordPress, is taken via jQuery.
You can do something similar to this solution from Newspaper – https://forum.tagdiv.com/topic/image-caption/
Create a function for caption like this – http://screencast.com/t/KXhJRflC4O
// Show captions on template 6
function get_template6_caption($post)
{
$thumbnail_id = get_post_thumbnail_id($post->ID);
$thumbnail_image = get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment'));
if ($thumbnail_image && isset($thumbnail_image[0]) && $thumbnail_image[0]->post_excerpt) {
return '<div class="template_6_caption"><span class="td-block-author">' . $thumbnail_image[0]->post_excerpt . '</div></span>';
}
}
And call it in single_template_6.php – http://screencast.com/t/8hb8dcT1
<figcaption class="wp-caption-text">
<?php echo get_template6_caption($post); ?>
</figcaption>
Also you need to adjust with custom css in Theme Panel > Custom Css and adjust it like you wish: http://screencast.com/t/CXV7k88QP
.template_6_caption .td-block-author {
position:relative;
color:#ffffff;
background-color: #222222;
padding:5px;
}
@media (min-width: 768px) and (max-width: 1023px){
.template_6_caption .td-block-author {
top: -20px;
}
}
@media (max-width: 767px){
.template_6_caption .td-block-author {
top: -30px;
}
}
Thanks!
-
This reply was modified 11 years by
Alin [tagDiv].
