Move custom p tag to function