admin管理员组文章数量:1391776
I've been asked to create a WordPress blog where the home page has a "featured posts" section that looks like this:
-------------------------
| A | | D |
| | | |
------- C |------
| | | |
| B | | E |
-------------------------
where each of those blocks is a blog post. I can achieve that design with CSS, but the client has asked to have arbitrary control over which post goes into which slot. In other words, they aren't just getting laid out chronologically.
My question is: is this a reasonable ask for WordPress, and if so, is there a plugin or theme that could help implement this?
My first thought was to use tags. For example, I could create a subset of "hidden" tags that all start with some sort of prefix, like --home-feature-a
, --home-feature-b
, etc. This would require filtering out the hidden tags wherever they're presented to the user, but I'm not sure how else to flag content like this.
Any tips would be much appreciated!
I've been asked to create a WordPress blog where the home page has a "featured posts" section that looks like this:
-------------------------
| A | | D |
| | | |
------- C |------
| | | |
| B | | E |
-------------------------
where each of those blocks is a blog post. I can achieve that design with CSS, but the client has asked to have arbitrary control over which post goes into which slot. In other words, they aren't just getting laid out chronologically.
My question is: is this a reasonable ask for WordPress, and if so, is there a plugin or theme that could help implement this?
My first thought was to use tags. For example, I could create a subset of "hidden" tags that all start with some sort of prefix, like --home-feature-a
, --home-feature-b
, etc. This would require filtering out the hidden tags wherever they're presented to the user, but I'm not sure how else to flag content like this.
Any tips would be much appreciated!
Share Improve this question asked Feb 7, 2020 at 0:16 bertdaybertday 1196 bronze badges1 Answer
Reset to default 1I think it's a very reasonable 'ask' for Wordpress. If it were me, I'd use Advanced Custom Fields for this, and set up some fields on the homepage so that the user can easily choose the relevant posts they want to show on those spots. You can call them Spot A, Spot B, or whatever you want.
I'd set these up using the ACF Post Object field.
Once you've set these up, the user can choose the relevant post from an easy list (see below - however you'd just limit it to posts and not show pages and attachments etc).
In your backend, you then look for the relevant chosen post object to show.
Of course, there are myriad other ways, including tags etc. However, the tags will have some tricks and hurdles, and - to put it bluntly - can more easily be 'stuffed up' by your client.
Good luck, and let us know how you go!
本文标签: theme developmentHow to control layout of posts on page
版权声明:本文标题:theme development - How to control layout of posts on page? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744771322a2624356.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论