Title: &#8220;Trending Posts&#8221; extension
Last modified: July 23, 2021

---

# “Trending Posts” extension

 *  Resolved [Mushlih Almubarak](https://wordpress.org/support/users/mushlih/)
 * (@mushlih)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/)
 * In the “Trending Posts” extension, what query ID is used to display the trending
   posts?
    Because I want to display trending posts using elementor. I’ll put the
   query [here](https://imgur.com/rmJd1cs) so elementor can order by posts based
   on what’s trending in your extension.
    -  This topic was modified 4 years, 9 months ago by [Mushlih Almubarak](https://wordpress.org/support/users/mushlih/).
    -  This topic was modified 4 years, 9 months ago by [Mushlih Almubarak](https://wordpress.org/support/users/mushlih/).

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

 *  [Eduard](https://wordpress.org/support/users/cteduard/)
 * (@cteduard)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14692444)
 * Hello [@mushlih](https://wordpress.org/support/users/mushlih/)
 * The Trending Posts extension sorts the posts or products by the number of comments
   or number of reviews.
 *  Thread Starter [Mushlih Almubarak](https://wordpress.org/support/users/mushlih/)
 * (@mushlih)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14692922)
 * Doesn’t it depend on the post view?
 *  [Eduard](https://wordpress.org/support/users/cteduard/)
 * (@cteduard)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14693028)
 * [@mushlih](https://wordpress.org/support/users/mushlih/)
 * At the moment, we’re only querying the number of comments/reviews. We do plan
   on adding more functionality to this extension in the future 🙂
 *  Thread Starter [Mushlih Almubarak](https://wordpress.org/support/users/mushlih/)
 * (@mushlih)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14693479)
 * If so, what query should I write in elementor to display popular posts from your
   plugin? because I want to display trending posts using elementor but order by
   popular from your plugin extension
 *  [Eduard](https://wordpress.org/support/users/cteduard/)
 * (@cteduard)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14693635)
 * [@mushlih](https://wordpress.org/support/users/mushlih/)
 * Elementor has its own query guidelines, documented here — [https://developers.elementor.com/custom-query-filter/](https://developers.elementor.com/custom-query-filter/)
 * You’ll need to create a filter and give it an ID, after that, you’ll be able 
   to place it inside the Elementor editor.
 * Thanks
 *  Thread Starter [Mushlih Almubarak](https://wordpress.org/support/users/mushlih/)
 * (@mushlih)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14694288)
 * > You’ll need to create a filter and give it an ID
 *     ```
       <?php
       // Filter for popular posts
       add_action( 'elementor/query/my_custom_filter', function( $query ) {
       	// What query from your plugin should I put here to display the most popular posts? Example: mysqli_query(SELECT post_id FROM popular);
       } );
       ```
   
    -  This reply was modified 4 years, 9 months ago by [Mushlih Almubarak](https://wordpress.org/support/users/mushlih/).
 *  Thread Starter [Mushlih Almubarak](https://wordpress.org/support/users/mushlih/)
 * (@mushlih)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14711217)
 * Any respond [@cteduard](https://wordpress.org/support/users/cteduard/) ?
 *  [Eduard](https://wordpress.org/support/users/cteduard/)
 * (@cteduard)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14711221)
 * Hello [@mushlih](https://wordpress.org/support/users/mushlih/)
 * Unfortunately, the email notification never came from your last reply.
 * I cannot give you a query example because every database and config is different.
   You can look on Google on how to select and sort the database contents in the
   front end. Here’s an article that might help you get started — [https://www.databasejournal.com/features/mysql/article.php/3904531/The-10-Most-Common-MySQL-Queries.htm](https://www.databasejournal.com/features/mysql/article.php/3904531/The-10-Most-Common-MySQL-Queries.htm)
 * Thanks
 *  Thread Starter [Mushlih Almubarak](https://wordpress.org/support/users/mushlih/)
 * (@mushlih)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14723748)
 * I already understand how to run SQL queries.
    But what is the name of the database
   table created by your plugin to sort popular posts?
 *  Theme Author [Creative Themes](https://wordpress.org/support/users/creativethemeshq/)
 * (@creativethemeshq)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14727240)
 * [@mushlih](https://wordpress.org/support/users/mushlih/) We do not create any
   additional DB tables to implement the posts sorting. Like [@cteduard](https://wordpress.org/support/users/cteduard/)
   already told you, we sort posts by the number of comments and to implement that
   you don’t need anything from our side — everything’s already present in WordPress
   core.
 * Just have a look at the `orderby` argument for `WP_Query`, it describes all the
   details: [https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters](https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters)
 * In the Trending Posts extension we use `'orderby' => 'comment_count'`. If you
   want more details, just have a look at the [implementation file itself](http://plugins.svn.wordpress.org/blocksy-companion/trunk/framework/extensions/trending/helpers.php)—
   the `blc_get_trending_posts_value()` function is the one responsible for querying
   posts in the correct order.
 * Hope this helps.
 *  Thread Starter [Mushlih Almubarak](https://wordpress.org/support/users/mushlih/)
 * (@mushlih)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14737003)
 * Perfect [@creativethemeshq](https://wordpress.org/support/users/creativethemeshq/)!
   This answer is what I expected.
 * I have 1 more question, what is the difference between the “Trending Posts” extension
   and the “Popular/Recent Posts” in the “Widgets” extension?
    For more details 
   see [this image](https://imgur.com/zt52XsV). Isn’t it the same to sort trending
   posts by comments?
 *  [Eduard](https://wordpress.org/support/users/cteduard/)
 * (@cteduard)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14737192)
 * Hello [@mushlih](https://wordpress.org/support/users/mushlih/)
 * The Trending Posts extension is a bar always present (depending on the display
   conditions!) throughout your website. It can be placed around the header or footer(
   Premium feature).
 * We’ve recently released a video showcasing our trending posts extension — [https://www.youtube.com/watch?v=mqAW5UWx6OY](https://www.youtube.com/watch?v=mqAW5UWx6OY)
 * The Recent/Popular posts widget is simply a block that can be placed throughout
   the widget areas from Blocksy. They include the sidebar and the header or footer.
 * Hope this clarifies the situation.
 * Thanks
 *  Thread Starter [Mushlih Almubarak](https://wordpress.org/support/users/mushlih/)
 * (@mushlih)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14738262)
 * Does that mean the difference only in appearance? There is no difference in how
   to list/order by the popular post?
    -  This reply was modified 4 years, 9 months ago by [Mushlih Almubarak](https://wordpress.org/support/users/mushlih/).
 *  [Eduard](https://wordpress.org/support/users/cteduard/)
 * (@cteduard)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14738266)
 * Yes, the only difference is the appearance of the block.
 *  Thread Starter [Mushlih Almubarak](https://wordpress.org/support/users/mushlih/)
 * (@mushlih)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14745757)
 * Ok, thank you

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

The topic ‘“Trending Posts” extension’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/blocksy/2.1.41/screenshot.jpg)
 * Blocksy
 * [Support Threads](https://wordpress.org/support/theme/blocksy/)
 * [Active Topics](https://wordpress.org/support/theme/blocksy/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/blocksy/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/blocksy/reviews/)

 * 15 replies
 * 3 participants
 * Last reply from: [Mushlih Almubarak](https://wordpress.org/support/users/mushlih/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/trending-posts-extension/#post-14745757)
 * Status: resolved