Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to display activity id in markup in permalink page?

  • @aljuk

    Member

    I’m placing an h1 in my members/single/activity/permalink.php ie. ‘Activity Permalink #123’ where I wish ‘123’ to be the corresponding activity id (as displayed at the end of the page’s url). How can I retrieve this?

    I’ve tried using and echoing `bp_get_activity_id()` and `bp_activity_id()` but no joy. I’m guessing because they’re not within a loop?

Viewing 3 replies - 1 through 3 (of 3 total)
  • @aljuk

    Member

    I think my answer lies in `$bp->action_variables` but how do I pull the value from this array?

    @aljuk

    Member

    I worked it out eventually:

    `global $bp;
    echo $bp->current_action;`

    @r-a-y

    Keymaster

    You can only use bp_get_activity_id() / bp_activity_id() during the activity loop.

    Glad you figured out how to grab the activity ID with the $bp global!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to display activity id in markup in permalink page?’ is closed to new replies.
Skip to toolbar