• Hi,
    I’m using YARPP for a while now. It does exactly what I wanted, but my project is now evolving. I have no clue how to deal with the next goals with YARPP. If you have any track that could help me, thank you very much.

    1. Show related posts and sort them by number of favorites
    My CPT shows related Bbpress topics thanks to YARPP.
    Currently, YARPP displays related topics and order them by date.
    I would love to keep this sorting but add to it another one :

    • order by number of favorite

    In Bbpress, users can favorite / unfavorite a topic.

    • Depending on the amount of “favorite” mentions received,
    • Show related bbpress topics

    2. Category template ?
    I’ve search a while for any project close to mine for this.
    I have multiple categories.
    In each categories, I have multiple posts.
    On my CPT, I would like to show related posts and order them by Categories.

    Example (that would return on my CPT) :
    – Cat 1
    — Post 1
    — Post 3
    – Cat 2
    — Post 2
    — Post 4

    I’ve read docs and some posts on forums about templates but didn’t come close to what I want.

    Many thanks to the person who could help me with all this.

Viewing 1 replies (of 1 total)
  • Plugin Support Michael Nelson

    (@mnelson4)

    Hi @specstanza, sorry I missed your message. Yes those are tricky goals and will require some coding.
    For objective 1, you’d need to identify how bbPress stores the count of favourites (probably a post meta entry, but you may want to ask some bbPress folks about that). Then use filters to modify the WP_Query used by YARPP to incorporate that data into the query, a bit like on this response: https://www.ads-software.com/support/topic/related-products-in-stock-or-on-backorder/#post-14584420
    2. Once you have your results, grouping them by category would require you to first loop over them all in the PHP template and group them by category. I’d use a two-level array: the top-level array keys would be a category ID or slug, and it’s value would be an array of posts using that category.
    Then once you’ve organized the results by category, loop over the top level of the two-level array, then show the category’s name, and the YARPP recommendations using that category.

    Does that help at all?

Viewing 1 replies (of 1 total)
  • The topic ‘Favorited bbpress topics’ is closed to new replies.