Skip to:

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

  • 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() ?>


    Thanks for any help.

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

  • JordashTalon


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



    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.




    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:

    <a title="Bill" href="">Bill</a> posted on the forum topic
    <a href="">Hi I am the Safari Man</a> in the group
    <a href="">Introduce Yourself</a>: <span class="time-since">  1 day, 19 hours ago</span> · <a title="View Thread / Permalink" href="">View</a>

    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