Title: Replace post/page content dinamically
Last modified: August 20, 2016

---

# Replace post/page content dinamically

 *  [2olive](https://wordpress.org/support/users/2olive/)
 * (@2olive)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/replace-postpage-content-dinamically/)
 * Hi all.
    I’m wondering if this is possible. All this regards a possible emergency
   situation: if there’s no emergency, then you have to behave like this if there’s
   this emergency, then you have to do this, this and this. The emergency situation
   is published on the front page of the website.
 * I’ve planned a situation like the following:
    In the front page I have one sticky
   post, let’s call it Apost, that belongs to category A. If this is published, 
   then I have a particular page (Apage) published too. If I publish Bpost, and 
   this is sticky, I want to have Bpage published, no more Apage.
 * How can I develop that?
 * Thank you

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

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/replace-postpage-content-dinamically/#post-3208085)
 * Sticky post IDs are stored in options table as an array under the key “sticky_posts”.
   Just use get_option() and update_option() to swap post IDs.
 *  Thread Starter [2olive](https://wordpress.org/support/users/2olive/)
 * (@2olive)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/replace-postpage-content-dinamically/#post-3208092)
 * Ooohh, thank you bcworkz!!! I’ll give it a try!
 *  Thread Starter [2olive](https://wordpress.org/support/users/2olive/)
 * (@2olive)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/replace-postpage-content-dinamically/#post-3208099)
 * I’m thinking about developing a child theme that’s triggered in that situation.
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/replace-postpage-content-dinamically/#post-3208100)
 * Good idea. Child themes are a good place to keep your hacks and modifications
   so they do not get overwritten during an update.
 * I imagine many people could use this sort of feature. If you’re hoping others
   can benefit from your efforts, most people will find a plugin more useful, if
   you can stay away from theme specific coding.

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

The topic ‘Replace post/page content dinamically’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 4 replies
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/replace-postpage-content-dinamically/#post-3208100)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
