• Thanks for this great plugin, I am using the “Display Posts” plugin to filter/list post, the only things it need is the “meta_key” to be able to used to filter all post by the figures of views. I guess this is the only thing I need from “Post view counter” to be able to work with the “display posts” please advise what’s the “meta_key” that I can used in “display posts” to filter all the posts. Thank you

    “Display Posts” https://en-gb.www.ads-software.com/plugins/display-posts-shortcode/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hey,

    I don’t know if you have already solve the problem or not, but I will add what I found to work for me recently.

    Solution 1:
    In one website/setup I use: Elementor + JetEngine + ACF + Post Views Counter
    The solution there was to use “Custom Query” like this ” {“orderby”:”post_views”} ”
    The code was added to a widget from “JetEngine” called “Posts”

    Solution 2:
    Other website/setup I used: similar to above but more complex structure and fully customized… There I needed the results to look in a specific way with dynamic functions, I have try ALL of the solutions provided by the developers and nothing worked also looked into the documents with no answer that worked.
    The solution in the end that worked for me was way simpler then I imagined:

    Use “Posts Query” with meta_key = “post_views” without the “”

    I hope this helps you and others having similar problems.

    Disclaimer!
    I’m not the developer of this plugin, nor am I affiliated to any mentioned plugins.

    BTW, if you wish further help with this just ask, I will try to help you with a solution that maybe is more specific to your setup.

    • This reply was modified 3 years, 7 months ago by Webzzz. Reason: forgot to add something
    Thread Starter freelylw

    (@freelylw)

    hi, thanks, I tired the meta_key=”post_views” in display-posts, but doesn’t work.
    Below is what I got from the display-posts description from the page display post meta description I guess it shouldn’t be difficult, but just I don’t know how to find out the information.

    meta_key
    Specify a meta key, for meta queries or ordering.
    Default: empty
    Example: [display-posts meta_key="price" orderby="meta_value_num" order="ASC"]
    
    meta_value
    Specify a meta value, for meta queries.
    Default: empty
    Example: [display-posts meta_key="color" meta_value="blue"]

    Hi Freelylw,

    Sorry for the long delay in response,

    I have to say I have never used the plugin you mentioned, but by looking at the code provided it seems as it should work as follows:

    [display-posts meta_key=”post_views” orderby=”meta_value_num” order=”ASC”]

    Or this:

    [display-posts wrapper=”div” wrapper_class=”my-grid-layout” meta_key=”post_views” orderby=”meta_value_num” order=”ASC”]

    Would you try and let me know?

    Alternatively ask the developer of the other plugin to check what can work.

    Worst case if this is not a super confidential project, I can try to help you by using TeamViewer or something similar to view the admin end together and see what would fix the problem.

    • This reply was modified 3 years, 6 months ago by Webzzz. Reason: Correcting text

    BTW, this codes are all missing what should the query call for? it doesn’t know if you want all post or pages or what category or taxonomy, so one needs to specify what you want it to display…? otherwise it will show all it can find.

    So in that case the code maybe will look like this:

    [display-posts category=”cars” meta_key=”post_views” orderby=”meta_value_num” order=”ASC”]

    if not category=”cars” then taxonomy=”cars” or post_type=”cars”

    Change “cars” to any category of post you would want to show…

    or maybe try this one:
    [display-posts meta_value=”post_views” orderby=”meta_value_num” order=”ASC”]

    Would have been really good to know exactly what was happening when you have try the codes… but I’m almost sure that one of the given codes should work.

    Anyhow please let us know what worked for you, in case someone else finds themselves in similar waters.

    This is probably the one that will work:
    [display-posts meta_value=”post_views” orderby=”meta_value_num” order=”ASC”]

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘meta-key for “display posts” to filter’ is closed to new replies.