Emperor Yuan of Han child Emperor Chengdy of Han
This action would cost Empress Xu her life, however, and cost Prince Shi his mother. Huo Guang's wife, Xian (顯), would not be denied her wish of making her daughter Huo Chengjun (霍成君) an empress. In 71 BC, Empress Xu was pregnant when Lady Xian came up with a plot. She bribed Empress Xu's female physician Chunyu Yan (淳于衍), under guise of giving Empress Xu medicine after she gave birth, to poison her. Chunyu did so, and Empress Xu died shortly after she gave birth. Her doctors were initially arrested to investigate whether they cared for the empress properly. Lady Xian, alarmed, informed Huo Guang what had actually happened, and Huo, not having the heart to turn in his wife, instead agreed to Chunyu's release.
In April 70 BC, Emperor Xuan created Huo Chengjun empress. Accustomed to luxury living, her palace expenditures far exceeded the late Empress Xu.
Huo Chengjun becoming empress was a threat to Prince Shi's life. On 24 May 67 BC, Emperor Xuan created the eight-year-old as Crown Prince Shi and created Empress Xu's father and Prince Shi's grandfather, Xu Guanghan, the Marquess of Ping'en.  Huo Guang opposed these actions. Huo's wife, Lady Xian  was shocked and displeased, because if her daughter ever had a son, that son could only be a prince and not the future emperor. She instructed her daughter to murder the crown prince. Allegedly, Empress Huo did make multiple attempts to do so, but failed each time. Around this time, the emperor also heard rumours that the Huos had murdered Empress Xu, which led him to begin stripping the Huos of actual power, while giving them impressive titles.
In 66 BC, after there had been increasing public rumours that the Huos had murdered Empress Xu, Lady Xian finally revealed to her son and grandnephews that she had, indeed, murdered Empress Xu. In fear of what the emperor might do if he had actual proof, Lady Xian, her son, her grandnephews, and her sons-in-law formed a conspiracy to depose the emperor. The conspiracy was discovered, and the entire Huo clan was executed by Emperor Xuan.  Empress Huo was deposed but not executed, but 12 years later she was exiled and, in response, she committed suicide.
What Empress Huo tried to do influenced Emperor Xuan in his choice of his next wife. At that time, he favoured his consorts Hua, Zhang and Wei, each of whom bore him children. He almost settled on Consort Zhang as his new empress. However, he hesitated, remembering how Empress Huo had tried to murder the crown prince. He therefore resolved to create an empress who was childless and kind. He decided on the gentle Consort Wang, and created her empress in 64 BC. Emperor Xuan put Prince Shi in her care, and she cared for him well.
Empress Wang would have a role in Crown Prince Shi's eventual choice of a wife. In the middle of the 50s BC, Consort Sima, the favourite consort of Prince Shi, died from an illness. Prince Shi was grief-stricken and became ill and depressed. Emperor Xuan was concerned, so he had Empress Wang select the most beautiful of the young ladies in waiting and had them sent to Prince Shi. Wang Zhengjun was one of the ladies in waiting chosen. She bore him his first-born son Liu Ao (劉驁, later Emperor Cheng) c. 51 BC. Prince Ao became Emperor Xuan's favourite grandson and often accompanied him.
During his years as crown prince, Prince Shi did not have a major role in government, given the forceful nature of his father's personality. He was taught the Confucian classics by a succession of Confucian scholars during his pre-teen and teenage years. Prince Shi became a mild-mannered and strict adherent of Confucian principles, unlike his father who made effective use of both Legalist and Confucian principles in his governance. This would bring his father's ire on him.
In 53 BC, when Emperor Xuan and Prince Shi were having dinner, he suggested that Emperor Xuan employ more Confucian officials in key positions. Emperor Xuan became extremely angry and commented that Confucian scholars were impractical and could not be given responsibilities, and further commented that Emperor Yuan's reign would lead to the downfall of the Liu imperial clan, words that would turn out to be prophetic. This would also bring his father to consider changing the succession plans, as he was also disappointed by Prince Shi's general lack of resolve. He considered creating Prince Shi's younger brother, Liu Qin, the Prince of Huaiyang, crown prince instead.  However, he could not bring himself to do so, remembering how Prince Shi's mother, Empress Xu, was his first love and had been murdered by poisoning, and also how he depended on his father-in-law in his youth. Prince Shi's position therefore was not seriously threatened.
In 49 BC, Emperor Xuan became seriously ill. Before his death, he commissioned his cousin-once-removed Shi Gao (史高), Prince Shi's teacher Xiao Wangzhi (zh:蕭望之), and Xiao's assistant Zhou Kan (周堪) to serve as regents. After he died, Prince Shi ascended the throne as Emperor Yuan.
offspring progeny issue descendant heir