Only show date on certain categories

Posted in: Newsmag
Post count: 45

We use Newsmag to run a magazine but only need post dates to be shown in the news category. Is there a simpel way to filter this? Custom CSS?
Thanks a lot.

Post count: 7909

Hi,

Did you hide the the date on all modules using custom css and you want to appear only on that specific category? Please provide more details about your customizations and also provide a link so we can take a look. You could use category’s unique class – http://screencast.com/t/uFnub8GE

Thanks!

Post count: 45

Hi Alin,
I am not using custom css. I just turn date on/off under Post Settings -> Show date. I would like to turn date on only on posts in the news category. Is that possible? Here is link to page http://naturguide.dk/
Thanks,

Post count: 7909

Hi,

Please make a backup of your current td_module.php file and then replace date function – http://screencast.com/t/ziIvhEnJfZK0 with this code – http://pastebin.com/DJVQw7Vw just replace your category slughttp://screencast.com/t/2ULeeWBxGj with your category name slug – http://screencast.com/t/d7E115SAZ4c

Hope this helps!

Post count: 45

Thanks a lot! It works when turning off date from Post Settings -> Show date!
Great support 🙂

Post count: 45

Hi Alin,
Since the latest update the above code does not work any more. Can you assist me how to change the td_module.php to only show date on posts in a certain category? In my case the news category.
Thanks,

Post count: 6535

Hi

The function’s code has been changed a bit, that’s why the previous changes don’t work now. Please make a backup of your current td_module.php file and then replace date function – http://screencast.com/t/ziIvhEnJfZK0 with this code: http://pastebin.com/S6FtcDhKhttp://screencast.com/t/mHLH9r8Md

Let us know how it goes.
Thanks!

Post count: 45

Hi Andrei,
Thank you for your quick reply. I have now made the changes and uploaded the modified td_module.php. It seems not to do the trick. Could you please have a look again?
Thanks,

Post count: 6535

Hi

Sorry about that, I provided a solution for a different approach.
I assume that the News category from your site have this name: http://screencast.com/t/HOC5l6BB If does try this code http://pastebin.com/rkT4N3Vd in td_module.php otherwise follow this link to adjust the changes: http://screencast.com/t/yxtMWtKfG6Y This code should display the date only for post from News category.

Let me know how it goes.
Thanks!

Post count: 45

Thanks Andrei,
It works fine! Thanks a lot 🙂

Post count: 45

Hi TagDiv guys,
Since the latest update (3.1) the above code does not work any more. Can you assist me how to change the td_module.php to only show date on posts in a certain category? In my case the news category.
Thanks,

Post count: 6535

Hi

Try this code, it should work properly: http://pastebin.com/7WiJ8wmu
Let me know ho it goes.
Thanks!

Post count: 45

Hi Andrei,
It does not seems to help! Instead comments count are now visible – even though disabled in Theme Panel???

Post count: 45

Hi Andrei,
I managed to turn of comments count (Meta info on Modules). However I still have not figured out how I can show post dates in the news category only.

Post count: 6535

HI

The code is tested and works fine, please check those screens where I’ve made a test for tech category: http://screencast.com/t/CYw2bpFihttp://screencast.com/t/6wVmiuJBcL2h Make sure you add the proper slug for yopur category or you can also add category id as parameter from in_category() function: http://screencast.com/t/Poej5Glv

Hope this helps.
Thanks!

Post count: 45

Hi Andrei,
The code does not work on single posts – only on modules/thumbnails. How do I, in single posts, only show dates in the news (nyheder) category?
Thanks,

Post count: 6535

HI

To work on single posts you need to edit td_module_single_base.php and add the same condition here: http://screencast.com/t/k1s2AplZNEAR

Thanks!

Post count: 45

That was the trick! Thank you.

Post count: 45

Hi TagDiv guys,
I used to edit the td_module_single_base.php to only show dates on posts in a certain category? In my case the news category. It does not seems to work in the latest version.
Can you please advice me how to fix this?
Thanks,

Post count: 23312

Hello Lisborg,

If you want to display the dates on posts in a certain category you should try using the is_category() function hardcoded in this file. So, if you are not aware of the steps which are needed to take in this case, please consider hiring a freelancer/developer to help you because we cannot provide custom services at the moment, sorry!

Thanks for the message!

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