Hi guys,
first of all thank you for this excellent product! I am a happy customer and just have a – hopefully – simple question.
In the file “loop-single.php” you are calling the post date in the meta.
<div class="meta-info">
<?php echo $td_mod_single->get_author();?>
<?php echo $td_mod_single->get_date(false);?>
<?php echo $td_mod_single->get_views();?>
<?php echo $td_mod_single->get_comments();?>
</div>
I am only able to change that date format in my wordpress overall settings. But I dont want to change it there, because that would change it for everything on my site! Can you please provide me a code snippet, I could use here to change the date format just in that file?
I`d like to show it like this: 5. November 2016 – 23:21
Which is “j. F Y – G:i” in my wordpress overall setting right now 😉
But that date and time format should only be showing in the posts (meta) and not on everything I am showing in my wordpress site.
I have only very basic understanding in coding, I hope u can help me without a lot of work here and that it is a very easy question for you pro-guys ;))
Looking forward to your answer. I hope I explained my question good enough. Thank you for your time and your support.
Yours,
Patrick
Hello PaTrock,
If you want to change the structure date for posts, you should edit the core file corresponding to your post template used by you. For example, if you are using the post template style 1, you should edit the loop-single-1.php like this -> http://screencast.com/t/N5DCrxo1 and the result you should see here -> http://screencast.com/t/bm0VMQprvAC
Hope this helps!
Thanks for the message!
Hi Catalln
thank you for your reply. That would have seemed to be an easy solution. Unfortunately it didn’t work out. I have put in the ‘j. F Y – G:i’ part its now:
<div class="meta-info">
<?php echo $td_mod_single->get_author();?>
<?php echo $td_mod_single->get_date('j. F Y - G:i');?>
<?php echo $td_mod_single->get_views();?>
<?php echo $td_mod_single->get_comments();?>
</div>
as u mentioned in your screens. I have put that code into all the templates loop- etc. I have erased cache on the side, and in my browser. I am using loop-single-7. I am also using a child theme, where my files that I change are. I also tried to do this on the original files – didnt change anything either. I can put into those round brackets of the “get_date” function all differnt styles. None are working. It is only changing on my page, when I am changing it in “wordpress” -> “settings” -> “general” where I can change it sitewide…
That is frustrating. Can you please elaborate? Do I have to change anywhere else something? It seems wordpress is overriding this settings here… just a thought. Hope you can help. Thanks in advance.
Greets
Hello PaTrocK,
You can handle the date format from the panel, like this -> http://screencast.com/t/17nK3de1IN Add the format j. F Y - G:i directly in the WP panel. Also, you should edit the top-menu.php core file and check here -> http://screencast.com/t/lI9G15wRs
Hope this helps!
Thanks for the message!
I have already written in both of my posts, that I was able to change the format via my wp panel. But that is changing it everywhere, for every plugin and so on.
I just want to change the format on these php files that I mentioned and not on my whole site.
<?php echo $td_mod_single->get_date(‘j. F Y – G:i’);?>
That did not work. Any other suggestions, how I can code here in php this format? I really need your help here.
Hello PaTrock,
Please try another time function like the_time(‘j. F Y – G:i’) and place it in the right place, like this ->
http://screencast.com/t/TVT32B8YSx
Hope this helps!
Thanks for the message!
Yes, that did the trick. Thank u!
I would just want to add a follow up question, as I thought that would solve all my problems 😉
But unfortunately the function “the_time” does not work on my starting screen. That is not in the loop. Its where I am using the different modules just like: td_module_mx9.php (line 31), if I do the function “the_time” there, it is showing the current time and not the time the post was posted.
So first of all thank you very much. If there is a possibility I could change the date format there too, that would be all I need to know. Your support is awesome! I have to say.
Hello PaTrock,
If you want to change the structure of date for all your modules, you should edit the theme core file like td_module.php and check the date format, like this -> http://screencast.com/t/DuKrKKBXyG and if you want to change it for each module you will have to create another function which this functionality and call it to your desired module.
Notice that is not a simple task and if you are not aware of the steps in this regard, please consider hiring a freelancer/developer to help you because we cannot provide custom work at the moment, sorry!
Thanks for the message!