Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Order/sort activity by “most favorites”

@r-a-y

Keymaster

@celsosoares – I haven’t debugged your code fully, but this section:

`WHERE meta_value = ‘favorite_count’ ORDER BY meta_value`

should be:

`WHERE meta_key = ‘favorite_count’ ORDER BY meta_value DESC`

—

Also, the documentation for the `include` parameter indicates that you have to pass a comma-delimited list of activity IDs.

So you’ll need to change this:

“

to:

`
<?php
$ids = implode( ‘,’, $favorite_id );

if ( bp_has_activities( ‘include=’ . $ids ) ) : ?>`

—

Again, I haven’t tested this, but give it a shot!

Skip to toolbar