Skip to:
Content
Pages
Categories
Search
Top
Bottom

Trying to add a class to the activity-header sub-section


  • jordashtalon
    Member

    @jordashtalon

    I’m trying to add a class to the name of the user who posted any type of activity (so I can style it somewhat bigger) but by default there is no class assigned to that hyperlink (only half of the hyperlinks have a class)

    What is the best way to add a class to that (is it possible without hacking core files?)

    This is the area in question

    <div class=”activity-header”>

    <?php bp_activity_action() ?>

    </div>

    Thanks for any help.

Viewing 3 replies - 1 through 3 (of 3 total)

  • jordashtalon
    Member

    @jordashtalon

    Any ideas, it seems like this should be easy to fix.


    21cdb
    Participant

    @21cdb

    You have to create your own child-theme to add a class, but you could also use :first-child property if you just want to style the “name of the user who posted something”.

    Search for .activity-list .activity-header a:first-child, or add it to your child-themes default.css and style it the whatever you want.


    jordashtalon
    Member

    @jordashtalon

    Hi,

    That would be a good way to do it for the name but a couple of other pieces generated by the function aren’t assigned a class, this function:

    <?php bp_activity_action() ?>

    outputs the following HTML:

    <p>
    <a title="Bill" href="http://domain.com/members/billjohnston/">Bill</a> posted on the forum topic
    <a href="http://domain.com/groups/introduce-yourself-232181584/forum/topic/hi-i-am-the-safari-man/">Hi I am the Safari Man</a> in the group
    <a href="http://domain.com/groups/introduce-yourself-232181584/">Introduce Yourself</a>: <span class="time-since">  1 day, 19 hours ago</span> · <a title="View Thread / Permalink" href="http://domain.com/groups/introduce-yourself-232181584/forum/topic/hi-i-am-the-safari-man/#post-6">View</a>
    </p>

    As you can see the name, group, forum topic, and other links like that aren’t assigned any class, how could I add classes to the output of the function?

    Now that you mention it, would I should be able to style the second hyperlink ( The forum Topic ) .acivitiy-list .activity-header a:second-child is that correct?

    I just wish I could make it more exact and each individual hyperlink had it’s own class.

    Thanks for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Trying to add a class to the activity-header sub-section’ is closed to new replies.
Skip to toolbar