Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How do I hide the date and author information on pages? I have turned it off in the global settings but it stays on the page.
Comments
Comment #1
tnats CreditAttribution: tnats commentedI had to make sure that I had enabled write access to /sites/default/files for it to work.
Comment #2
CFW CreditAttribution: CFW commentedThanks, for your suggestion.
I enabled write access (0777) on /sites/default/files but this doesn't solve the problem.
Comment #3
jansselt CreditAttribution: jansselt commentedThe date on the left hand side is is generated by the following code in the node.tpl.php
To make it only show for blog posts and not on normal/information pages I added the following which seems to do the job for now until an option is built in to turn this off...
Hope that helps!
Comment #4
CFW CreditAttribution: CFW commentedThanks, it works perfect now.
I also hide the author, see blow:
Is this the right way? Thanks again!
Comment #5
jansselt CreditAttribution: jansselt commentedWell, I don't want to call it the right way. Will it work? For now, yes. Is it the way this should be done? In my opinion, no.
This should be a built in option on the theme. The problem with the solution I supplied and your solution to the author information is that if the theme ever gets updated, its going to overwrite this fix. We would have to apply it again after updating. Not the end of the world, but not the proper way to be handling this.
Of course you could just neglect any future updates.
Comment #6
Jarek Foksa CreditAttribution: Jarek Foksa commentedThere is a more elegant way to do this, I just had to wrap the date and user name with if ($display_submitted) statement:
This way you can enable or disable date and author information in content type settings, under the "Display settings" tab. I will commit the fix in a moment.
Comment #7
Jarek Foksa CreditAttribution: Jarek Foksa commentedFixed in release 1.6
Comment #9
eku28 CreditAttribution: eku28 commentedThis is still a problem, turning off the display settings doesn't work. Is the only fix still going into the node.tpl.php? I'm having this same problem with every drupal 7 theme.
Comment #10
eku28 CreditAttribution: eku28 commentedMy previous post is actually a different problem: the date and author information (and then the title) are appearing underneath the content page in the same font size.
It's kind of weird because after a few screen refreshes then a separate "Read more" appears underneath the duplicate title and then again underneath the date and author information, so I'll end up with 3 "Read more's" on one content page. But this is using an acquia drupal stack and it's not happening with xampp or wampserver drupal 7 installation.
I'll keep this acquia stack installation for a while to try to learn how to fix a problem like this.
Comment #12
strauch CreditAttribution: strauch commentedFor 6.x-1.8 this solution doesn't work, i have this solution:
Comment #13
did1979 CreditAttribution: did1979 commentedI would like to print the taxonomy terms instead of the date (or the username).
But when I try with the variable $terms in the node.tpl.php I am getting an error : undefined variable $terms... in node.tpl.php
thanks.
Comment #14
did1979 CreditAttribution: did1979 commentedI re-close this issue becaus I've opened a new one on D7 1.8 version.
Did