kitfreeman on "[Plugin: User Submitted Posts] Force uploaded images to resize"

ساخت وبلاگ

Sure, as it says right there in the plugin settings:

Markup to use for each submitted image (when auto-display is enabled). Can use %%width%%, %%height%%, %%thumb%%, %%medium%%, %%large%%, %%full%%, %%custom%%, and %%title%%.

So you can use the provided markdown along with the full-image shortcode:

<a href="%%full%%"><img src="%%full%%" width="%%width%%" height="%%height%%" alt="%%title%%" style="display:inline-block" /></a>

And technically if you're displaying the full image you're probably fine omitting the link, so you can do this to save some bytes:

<img src="%%full%%" width="%%width%%" height="%%height%%" alt="%%title%%" style="display:inline-block" />

"the markdown for uploaded images doesn't show up in the html for the submitted post. Is it applied automatically by the plugin when the post is viewed?"

Ah good catch, I should have looked a little closer instead of relying on memory ;) So what you need to do is, instead of applying the custom class in the markdown, just use the existing classes that are generated by the plugin. So instead of the CSS example provided above, you can do this instead:

.usp-images-wrap img { width: 95%; max-width: 95%; }

That should do the trick, and just ignore the previous step of adding usp-image to the markdown -- it's not necessary.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 101 تاريخ : چهارشنبه 15 ارديبهشت 1395 ساعت: 2:44