Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide time-since with CSS

  • Profile photo of grafcom
    Gunu
    Participant

    @grafcom

    Hello,

    I found different answers here on Support, but only one of the two works.

    I want to hide span.activity and have put the following in the style.css of my theme and this works

     span.activity {
            display: none !important;
        }

    However, I would also hide time-since and placed next code in the css file

    span.time-since {
            display: none !important;
        }

    but this has no effect

    I use:
    Wordpress 3.9.1
    Buddypress 2.0.1
    bbPress 2.5.4
    BuddyPress Groups Extras 3.6.5
    BP Group Documents 1.7
    rtMedia for WordPress, BuddyPress and bbPress 3.7.2
    Theme is Genesis child theme Executive Pro

    Can anyone point me in the right direction?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Profile photo of Henry Wright
    Henry Wright
    Moderator

    @henrywright

    Are you sure span.time-since is the right selector?

    Profile photo of grafcom
    Gunu
    Participant

    @grafcom

    @henrywright

    I think so…. Using Firebug gives me
    <span class="time-since">1 day, 1 hour ago</span>

    The time stands at – uploaded the file: – 1 day, 1 hour ago

    The time at active is gone with the activity code in the CSS

    Profile photo of Henry Wright
    Henry Wright
    Moderator

    @henrywright

    @grafcom I’m not sure why your code isn’t working. Firebug is telling you the selector is time-since and you’re doing this in your CSS file:

    span.time-since {
        display: none !important;
    }

    There must be something else going on. Do you have any more style sheets loading which may take precedence over your theme’s style.css? Are any inline styles being added?

    Profile photo of grafcom
    Gunu
    Participant

    @grafcom

    @henrywright

    I found this:

    in – plugins/buddypress/bp-themes/bp-templates/bp-legacy/css there is a file named buddypress.css

    In that file I found the following three references:

    	#buddypress a.activity-time-since {
    	color: #aaa;
    	text-decoration: none;
    	
    }
    	#buddypress table.forum td.td-freshness span.time-since {
    	font-size: 80%;
    	color: #888;
    	
    }
    	#buddypress a.activity-time-since:hover {
    	color: #888;
    	text-decoration: underline;
    	
    }

    I’ve copied this to the style sheet of my theme and in all three I tried the value display: none;
    No effect.

    BUT with some experimentation I put this in the css of my theme:

    	#buddypress a.activity-time-since {
    	color: #aaa;
    	text-decoration: none;
    	
    }
        span.time-since {
            display: none;
        }
    
    }

    OOPS, now it works!

    It only works if it is in that order in the style sheet.

    Profile photo of grafcom
    Gunu
    Participant

    @grafcom

    Aagrh!

    I found that the reason it did not work —- ME!

    There was a } too much in a place where it did not belong – Aagrh!

    span.time-since {
        display: none;
    }

    It works!

    @henrywright
    Thanks for your comments

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hide time-since with CSS’ is closed to new replies.