Edit Image Widths in the_content()
-
I want to make it so Screenshot posts are formatted easily by automatically editing the image widths to fit onto my page.
This is what I have so far:
$contentWidth = 'width=\"600px\"'; $quarterWidth = 'width=\"25%\"'; $halfWidth = 'width=\"50%\"'; $fullWidth = 'width=\"100%\"'; $screenContent = the_content(); $screenContent = preg_replace("/width=\"(.*?)\"/is", $contentWidth, $screenContent); echo $screenContent;
However the preg_replace must not be working as the image in the post is still huge. Any suggestions?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Edit Image Widths in the_content()’ is closed to new replies.