Classes on images

This topic is: resolved
Viewing 5 posts - 1 through 5 (of 5 total)
Author Posts
May 28, 2013 at 12:43 am #3086
Bart Dabek
Post count: 24

Is there a way to specify a css class or id to be added to an image ie in

$video->featured_image->resize(“w=239&h=181”)

May 28, 2013 at 12:48 am #3087
Bart Dabek
Post count: 24

Sorry got this figure out… however is it possible to do this on one line?

$video->featured_image->attr(‘class’,’bdr-img’);
echo $video->featured_image->resize(“w=239&h=181”); ?>

May 28, 2013 at 8:44 am #3088
traversal
Post count: 207

Hey Bart. Yep you can do this on one line. Internally, the string output of that field calls into a “tag” method which you can explicitly call like so:

http://pastie.org/7971336

May 28, 2013 at 10:25 pm #3098
Bart Dabek
Post count: 24

That worked perfectly thanks so much… one last question on this topic… any plans on including default image feature within the image class? So that we don’t have to do the ifelse statement?

May 29, 2013 at 8:46 am #3104
traversal
Post count: 207

No problems. No plans as yet, but noted for the future.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Latest From the Blog

MasterPress 1.3.10 is now available

9th November 2023

MasterPress 1.3.10 is a feature and bugfix release. Workaround for fatal error introduced by changes to WordPress’ wpdb class in WordPress 6.4. Added actions to MPC files upload_field & WF image save_image functions.

Plugin Requirements

MasterPress requires a minimum of WordPress version 4.9, MySQL 5.6, and PHP version 5.6.20.

We also recommend that PHP is configured to use a memory limit of 64MB per request (128MB may be required for sites with higher complexity).

This plug-in is not compatible with the WordPress.com hosted service.

Three AM