 He was then given the additional post of deputy minister of census (戶部侍郎, "Hubu Shilang"), and later was made the deputy minister of rites (禮部侍郎, "Libu Shilang") but no longer imperial scholar by that point.As of 905, Zhang was still serving as the deputy minister of rites—at that time, at Luoyang, which had been made the capital after the powerful warlord Zhu Quanzhong the military governor of Xuanwu Circuit (宣武, headquartered in modern Kaifeng, Henan) had forcibly moved Emperor Zhaozong from Chang'an to Luoyang in 904,—under Emperor Zhaozong's son and successor Emperor Ai, as Zhu had had Emperor Zhaozong assassinated late in 904.In 905, the chancellor Liu Can, an associate of Zhu's, had alienated Zhu from the other chancellors Pei Shu, Dugu Sun, and Cui Yuan; Pei, Dugu, and Cui were therefore removed from chancellor offices, while Zhang and Yang She were made chancellors, with the designation "Tong Zhongshu Menxia Pingzhangshi" (同中書門下平章事).