Reputation: 11
i'm have problem with CSS coding in wordpress template , i need to remove Post Date from website i already remove it from single-page my issue in homepage
i took this code from using "source page"
<div class="post-time-container">
<span class="post-time-icon fa fa-clock-o"></span>
<time class="post-time-icon fa fa-clock-o"></span>
<time class=>05.05.2015</time>
there is window in my template allow me to put CSS codes i tried
.time class
{
display: none;
}
.entry-date
{
display: none;
.time
{
display: none;
}
didn't works
please what the code i should write in this case IN CSS template window
thanks
Upvotes: 0
Views: 1326
Reputation: 862
I fully agree with Paul's answer from a CSS perspective - purely as an alternative you can achieve a similar outcome by placing the following code after the opening <?php
line of your theme's functions.php file
function jl_remove_post_dates() {
add_filter('the_date', '__return_false');
add_filter('the_time', '__return_false');
add_filter('the_modified_date', '__return_false');
} add_action('loop_start', 'jl_remove_post_dates');
With your updated question - change
.time
{
display: none;
}
to
time
{
display: none;
}
on the 'empty' css file on your editor (I am assuming this is put in place for custom css on your theme)
Upvotes: 0
Reputation: 27082
.time class
means <element class="time"><class>...</class></element>
. It's not what you want.
Use
time {...}
Or
time.classname {...} /* for HTML <time class="classname"> */
EDIT:
You wrote you have this HTML
<div class="post-time-container">
<span class="post-time-icon fa fa-clock-o"></span>
<time class=>05.05.2015</time>
First, remove the =
from the 4th line. And then hide the second time
using
.post-time-container time {display: none}
Upvotes: 1
Reputation: 3368
In your html file do this:
<time class="time">05.05.2015</time>
Then in your CSS file, do this:
.time
{
display: none;
}
This will resolve your issue because you didn't have anything assigned to your div class in your html file.
Upvotes: 3