Title: Home Page Posts
Last modified: July 13, 2022

---

# Home Page Posts

 *  [james11223456](https://wordpress.org/support/users/james11223456/)
 * (@james11223456)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/theme-development-home-page-posts/)
 * Hi,
 * I’m developing a theme for a news/magazine type blog site.
 * On the homepage I would like to be able to manage what post shows as the homepage
   cover image, and also tile another 4 posts to the right of this.
 * How can I flag the posts in the back office to show as the cover image/post on
   the homepage, and also flag which posts show in tile area on the right.
 * Is there a machanism to add a custom field in the back office for ‘show as homepage
   cover’, and ‘show as homepage tile 1′, ’tile 2′, etc – and then query these posts
   in the theme template to show in the allocated postions?
 * I’ve brefily looked at ‘sticky posts’ but then I cant see a way how to control
   which post is displayed in the correct/allocated postion.
 * Any pointers in the right direction would be helpful please.
 * Thanks, J
    -  This topic was modified 3 years, 11 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Moved to Fixing WordPress, this is not an Developing with WordPress
      topic

Viewing 1 replies (of 1 total)

 *  [Alan Fuller](https://wordpress.org/support/users/alanfuller/)
 * (@alanfuller)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/theme-development-home-page-posts/#post-15819862)
 * First, as this is in the ‘developing’ forum I’ll assume you are a developer and
   want to code a solution from scratch ( as there are plugins and libraries that
   can simplify but they create a dependency for your theme).
 * The first thing you need to know about is post meta – this is also known as custom
   fields and the relevant functions are add_post_meta() and update_post_meta.
 * You will also need to add a metabox to posts so that the custom fields can be
   updates and so you will need add_meta_box() [https://developer.wordpress.org/reference/functions/add_meta_box/](https://developer.wordpress.org/reference/functions/add_meta_box/)
 * Then you will need to hook into saving the post `save_post` to actually apply
   the update of meta data. [https://developer.wordpress.org/reference/hooks/save_post/](https://developer.wordpress.org/reference/hooks/save_post/)
 * Finally you will need to modify the query loop(s) in your templates to reference
   the correct custom data – see WP_Query [https://developer.wordpress.org/reference/classes/wp_query/#custom-field-post-meta-parameters](https://developer.wordpress.org/reference/classes/wp_query/#custom-field-post-meta-parameters)
 * That is the basic stuff. There are probably dozens of tutorials on this and also
   different approaches to achieve the same result but the above are the basic tools.
   Here is one [https://www.sitepoint.com/adding-custom-meta-boxes-to-wordpress/](https://www.sitepoint.com/adding-custom-meta-boxes-to-wordpress/)
 * The above mechanism works for classic editor, the block editor (Gutenberg ) and
   all page builders.
 * However IF you are developing for the Block Editor ONLY ( Gutenberg ) you can
   use post / page controls – I would say this is a tad more complex especially 
   if not familiar with REACT – however there is a reasonable tutorial I found here
   [https://wholesomecode.ltd/add-controls-to-the-post-sidebar-with-plugindocumentsettingpanel](https://wholesomecode.ltd/add-controls-to-the-post-sidebar-with-plugindocumentsettingpanel)

Viewing 1 replies (of 1 total)

The topic ‘Home Page Posts’ is closed to new replies.

## Tags

 * [theme development](https://wordpress.org/support/topic-tag/theme-development/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Alan Fuller](https://wordpress.org/support/users/alanfuller/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/theme-development-home-page-posts/#post-15819862)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
