  Coding theory and $t$-designs have close connections and interesting
interplay. In this paper, we first introduce a class of ternary linear codes
and study their parameters. We then focus on their three-weight subcodes with a
special weight distribution. We determine the weight distributions of some
shortened codes and punctured codes of these three-weight subcodes. These
shortened and punctured codes contain some codes that have the same parameters
as the best ternary linear codes known in the database maintained by Markus
Grassl at http://www.codetables.de/. These three-weight subcodes with a special
weight distribution do not satisfy the conditions of the Assmus-Mattson theorem
and do not admit $2$-transitive or $2$-homogeneous automorphism groups in
general. By employing the theory of projective geometries and projective
generalized Reed-Muller codes, we prove that they still hold $2$-designs. We
also determine the parameters of these $2$-designs. This paper mainly confirms
some recent conjectures of Ding and Li regarding Steiner systems and
$2$-designs from a special type of ternary projective codes.
