Whenever the petition is filed by the minor and the guardian it shall be the duty of the clerk to give notice of the filing of such petition in some newspaper published in the county or, if no newspaper is published in such county, then in such manner as may be prescribed by the judge. Such notice shall be given once a week for three successive weeks before the time of hearing such petition. Whenever the petition is filed under subdivision (1) of Section 26-13-1, a copy of the petition must be served on the minor by the sheriff if the minor resides in this state or, if a nonresident or absent from the state, by registered or certified mail.