(The Bible states that she had other children though.)
Actually, no. Look carefully please:
Before we begin, please pray, and open your Bible.
We can know that Jesus was the ‘firstborn’ of Mary, as per St. Matthew 1:25; St. Luke 2:7.
Now, because of the term, ‘firstborn’, many incorrectly teach that it
automatically implies, further children (of Mary, by Joseph),
but this is not necessarily the case, as the word ‘firstborn’ has a range of meaning, from simply the original child of inheritance, and also the first to be born among others later to come (1 Samuel 8:2; 1 Chronicles 3:1,15, 8:1,39, 26:2,4, &c.), and even has a greater meaning, than simply ‘first child to be born’, but is used to describe even those who are not a first child, but that which is the child through whom the inheritance or blessing or rulership comes:
Consider that Numbers 3:42,43, 18:15, 33:4; Judges 11:34; or Nehemiah 10:36; Psalms 78:51, 105:36, 135:8; or Luke 1:7-80, 9:28, &c. In some of those cases there was only a single child, and yet, would be the “firstborn”. Even the ‘only’ children in those cases are ‘firstborn’, even if they never had another child after. There is no indication that all the Israelites, or all the Egyptians had other child after their ‘firstborn’, though many would have. In the cases of John the Baptist, Jesus and the daughter of Jephthae, and the son of the man who came to Jesus, &c. they are only children, yet would be considered ‘firstborn’.
Genesis 10:15, 19:31,33,34,37, 22:21, 25:13,25, 27:19,32, 29:26, 35:23, 36:15, 38:6,7,28, 41:51, 43:33, 46:8, 48:14,18, 49:3; Exodus 4:23, 6:14, 11:5, 12:12,29, 13:2,13,15, 22:29, 34:20; Numbers 3:2,12,13,40,41,42,43,45,46,50, 8:16,17, 18:15, 33:4; Deuteronomy 21:15,16,17, 25:6; Joshua 6:26, 17:1; Judges 8:20; 1 Samuel 8:2, 14:49, 17:13; 2 Samuel 3:2; 1 Kings 16:34; 1 Chronicles 1:13,29, 2:3,13,25,27,42,50, 3:1,15, 4:4, 5:1,3, 6:28, 8:1,30,39, 9:5,31,36, 26:2,4; 2 Chronicles 21:3; Nehemiah 10:36; Psalms 78:51, 105:36, 135:8, 136:10; Micah 6:7; Matthew 1:25; Luke 2:7; Hebrews 11:28.
Continuing with the ‘firstborn’, in the greater sense, see:
Isaac over Ishmael: Genesis 22:2,12,16.
Ephraim was made firstborn, over Manasseh: Genesis 41:50-52, 48:16-20; Jeremiah 31:9.
Joseph over Reuben: Genesis 49:3; 1 Chronicles 5:1.
Jacob/Israel over Esau: Exodus 4:22; Genesis 25:25-26; Hosea 11:1; Matthew 2:13-15.
Levites over the others: Numbers 3:41-45, 8:14-18.
David over others: Psalms 89:20,27; 1 Samuel 16:10-11. David is a type of Christ (Luke 24:27; John 5:39).
Simri, over others: 1 Chronicles 26:10.
Jesus over all: Colossians 1:15-18; see also 2 Corinthians 1:20, and Romans 9:5; Colossians 1:26, 2:10; Ephesians 1:21-23, 3:9, 4:15; Hebrews 7:26; John 1:3.
However, Jesus is also the ‘firstborn’ (spiritually; Luke 1:35) of the ‘woman’, that ‘church in the wilderness (Acts 7:38), among many 'brethren": Isaiah 9:6; Luke 2:11; Hebrews 2:10-12; Revelation 12:1-5,13.
and there are other uses: Job 18:12-13; Isaiah 14:30.
Scripture records explicitly that:
“Therefore the Lord himself shall give you a sign; Behold, a virgin shall conceive, and bear a son, and shall call his name Immanuel.” Isaiah 7:14
“Now the birth of Jesus Christ was on this wise: When as his mother Mary was espoused to Joseph, before they came together, she was found with child of the Holy Ghost.” Matthew 1:18
“Behold, a virgin shall be with child, and shall bring forth a son, and they shall call his name Emmanuel, which being interpreted is, God with us.” Matthew 1:23
“And knew her not till she had brought forth her firstborn son: and he called his name JESUS.” Matthew 1:25
“To a virgin espoused to a man whose name was Joseph, of the house of David; and the virgin's name was Mary.” Luke 1:27
“And she brought forth her firstborn son, and wrapped him in swaddling clothes, and laid him in a manger; because there was no room for them in the inn.” Luke 2:7
This means that Mary had no children before Jesus, since He is called her “firstborn son” and she was a “virgin”, thus we can immediately eliminate any others before that time for her.
What then of afterwards, since it is written that Joseph “knew her not till she had brought forth” Jesus?, which would help indicate that their marriage was eventually consumated after her purification [Luke 2:22], as is the rightful God-gifted/given position of the married, Husband and Wife, before God [Genesis 2:24; Proverbs 5:18, 18:22; Matthew 1:25, 19:5; Mark 10:7; Ephesians 5:31; Hebrews 13:4, etc], Joseph fulfilling and “perform[ing] the duty of an husband” [see and compare Exodus 21:10; Deuteronomy 25:5,7, but in the case of an original husband to a new wife, etc], which includes intimacy of marital relations, and not remaining away from her forever, since that would lead to greater temptation for them both [1 Corinthians 7:5]. Though such marital relations are indeed indicated in the Scripture between Joseph and Mary [let us tread carefully in such areas, for they are personal, and generally private], this does not necessarily lead to further children, as is found the case with many a couple in Scripture, and as it is written, that those things are written about Jesus [John 5:39], being types in their lives pointing to Him and His life, etc.
Some, will of course, point to the term “firstborn”, and say that this means that there had to have been others afterwards born of Mary, being 'second-born' etc, yet the word itself, does not inherently dictate this, and is forced into it, by others which have an apriori, or preconceived notion to defend. The word simply means, “firstborn”, whether that child was the only one, or whether the first in a line/series of others/many, yet it is always the context which would indicate any further application or definition. Therefore, we need to consider some context.
Contextually, we do see that the Bible mentions that Jesus had “brothers” [named] and “sisters” [unnamed]:
“Then one said unto him, Behold, thy mother and thy brethren stand without, desiring to speak with thee.” Matthew 12:47
“Is not this the carpenter's son? is not his mother called Mary? and his brethren, James, and Joses, and Simon, and Judas?” Matthew 13:55
“Is not this the carpenter, the son of Mary, the brother of James, and Joses, and of Juda, and Simon? and are not his sisters here with us? And they were offended at him.” Mark 6:3
etc.