Request: time option for publish date on post page

Posted in: Newsmag
Post count: 9544

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);?>

Post count: 6600

Hi,

Thanks Chris for your suggestion!
I have added this on our request list and we’ll address it in a future update.

Thanks

Post count: 5

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 🙂

Post count: 9544

@EnkhbayarYu

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

Post count: 5

@Chris S

Thank you for being very helpful and nice to others just like an owner of theme 🙂

Thanks again and goodluck

Post count: 9544

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

Post count: 6

Thanks for this code. How is it possible to change the date format in german, like 12. Mai 2015 (May,12 2015)?

And is it possible to include when the post was updated? Because some News get more information one or two hours later, like here in example:

Time Postupdate

Post count: 7909

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!

Post count: 6

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.

Post count: 7909

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.phphttp://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!

Viewing 10 posts - 1 through 10 (of 10 total)
The forum ‘Newsmag’ is closed to new topics and replies.