I saw an article on some research done on pen height for hogs only. IIRC it was 28" to keep most hogs out. I cut some 50" panels in half to build 2 of my first pens. That height worked good for everything except pigs that go into the pen thru the larger squares in the wire. That led to them knocking down panels and larger hogs getting inside the pens. I rebuilt the pens using 34" tall hog panels and no problems since that time.
Unless you already have the cattle or 50" panel and do not want to spend anymore $$ on hog panels.
What you can do is cut the top three rows off the 50" panels, I think each square is 6" in diameter so that will bring the top of your pen down to 32".
Then use the 18" you cut off the top and wire them to the bottom where they are splitting the squares in half to make the bottom openings half their original size, that should stop the little porkers from getting in