first, the glory of God is the goodness of God, as God interpreted to Moses:
Exo 33:18 And he said, I beseech thee, shew me thy glory.
Exo 33:19 And he said, I will make all my goodness pass before thee...
if you look at verse 31 below in context, Paul is saying that we aren't bound by laws regarding what we eat - that even eating meat offered to idols is not sin to one who knows that he's free from the law and does not partake in the idol worship. but if someone else might be misled to participate in idol worship when they see you eat what was offered to idols, you should abstain for their sake rather than because of laws forbidding eating food offered to idols.
to act for the sake of others is selfless - and God is selfless - so to act in a selfless way reveals God's goodness to others - this attributes goodness to Him - this 'glorifies' Him.
1Co 10:27-33 KJV
(27) If any of them that believe not bid you to a feast, and ye be disposed to go; whatsoever is set before you, eat, asking no question for conscience sake.
(28) But if any man say unto you, This is offered in sacrifice unto idols, eat not for his sake that shewed it, and for conscience sake: for the earth is the Lord's, and the fulness thereof:
(29) Conscience, I say, not thine own, but of the other: for why is my liberty judged of another man's conscience?
(30) For if I by grace be a partaker, why am I evil spoken of for that for which I give thanks?
(31) Whether therefore ye eat, or drink, or whatsoever ye do, do all to the glory of God.
(32) Give none offence, neither to the Jews, nor to the Gentiles, nor to the church of God:
(33) Even as I please all men in all things, not seeking mine own profit, but the profit of many, that they may be saved.