• Hi
    I have query to select latest post and its workign wrong and display one post from each category right now so its more than one. How can I fix that I just want the latest post only. ?

    Thanks

    Query here:

    {
        "name": "Sticky_Three_cols1",
        "slug": "sticky_three_cols1",
        "type": "widget",
        "path": null,
        "data": {
            "display": {
                "title": "",
                "style": "unformatted",
                "row_style": "fields",
                "post_settings": {
                    "size": "excerpt"
                },
                "field_settings": {
                    "group_by_field": "__none__",
                    "strip_group_by_field": "",
                    "fields": {
                        "featured_image": {
                            "type": "featured_image",
                            "hook_key": "featured_image",
                            "name": "featured_image",
                            "weight": "0",
                            "image_display_style": "news-list",
                            "link": "on",
                            "label": "",
                            "custom_output": "",
                            "classes": "",
                            "empty_field_content": ""
                        },
                        "post_title": {
                            "type": "post_title",
                            "hook_key": "post_title",
                            "name": "post_title",
                            "weight": "2",
                            "exclude_display": "on",
                            "link": "on",
                            "label": "",
                            "custom_output": "",
                            "classes": "",
                            "empty_field_content": ""
                        },
                        "post_excerpt": {
                            "type": "post_excerpt",
                            "hook_key": "post_excerpt",
                            "name": "post_excerpt",
                            "weight": "3",
                            "label": "",
                            "rewrite_output": "on",
                            "custom_output": "<h2>{{post_title}}</h2>rn<p>{{post_excerpt}}</p>rn",
                            "classes": "",
                            "empty_field_content": ""
                        }
                    }
                },
                "template_part_settings": {
                    "path": "",
                    "name": ""
                },
                "header": "",
                "footer": "",
                "empty": "",
                "wrapper-classes": "",
                "page": {
                    "pager": {
                        "type": "default",
                        "previous": "",
                        "next": ""
                    }
                }
            },
            "args": {
                "posts_per_page": "1",
                "post_status": "publish",
                "offset": 0,
                "sorts": {
                    "date": {
                        "type": "date",
                        "hook_key": "post_date",
                        "name": "date",
                        "weight": "0",
                        "order_value": "DESC"
                    }
                },
                "filters": {
                    "post_types": {
                        "type": "post_types",
                        "hook_key": "post_types",
                        "name": "post_types",
                        "weight": "0",
                        "post_types": {
                            "post": "post"
                        },
                        "exposed_label": "",
                        "exposed_desc": "",
                        "exposed_key": "",
                        "exposed_settings": {
                            "type": "select"
                        }
                    }
                }
            }
        }
    }
  • The topic ‘Limit to select one post’ is closed to new replies.