Hard X-ray fluorescence (XRF) microscopy offers unparalleled sensitivity for quantitative analysis of most of the trace elements in biological samples, such as Fe, Cu, and Zn. These trace elements play critical roles in many biological processes. With the advanced nano-focusing optics, nowadays hard X-rays can be focused down to 30 nm or below and can probe trace elements within subcellular compartments. However, XRF imaging does not usually reveal much information on ultrastructure, because the main constituents of biomaterials, i.e. H, C, N, and O, have low fluorescence yield and little absorption contrast at multi-keV X-ray energies. An alternative technique for imaging ultrastructure is ptychography. One can record far-field diffraction patterns from a coherently illuminated sample, and then reconstruct the complex transmission function of the sample. In theory the spatial resolution of ptychography can reach the wavelength limit. In this manuscript, we will describe the implementation of ptychography at the Bionanoprobe (a recently developed hard XRF nanoprobe at the Advanced Photon Source) and demonstrate simultaneous ptychographic and XRF imaging of frozen-hydrated biological whole cells. This method allows locating trace elements within the subcellular structures of biological samples with high spatial resolution. Additionally, both ptychographic and XRF imaging are compatible with tomographic approach for 3D visualization.