WAJ Image

WAJ Image

Wordpress plugin

Install on Wordpress

App Details

This plugin has 3 main classes, with a shortcode for each 1.

Shorcodes:
* [image src=”%url%”]
* [theme-image src=”%url%”]
* [upload-image src=”%url%”]
* [picture src=”%baseurl%” ext=”%ext%” sizes=”%sizes%”]
* [theme-picture src=”%baseurl%” ext=”%ext%” sizes=”%sizes%”]
* [upload-picture src=”%baseurl%” ext=”%ext%” sizes=”%sizes%”]
* [thumbnail]

Classes:
* WaughJ\HTMLImage\HTMLImage
* WaughJ\WPThemeImage\WPThemeImage
* WaughJ\WPUploadImage\WPUploadImage
* WaughJ\HTMLPicture\HTMLPicture
* WaughJ\WPThemePicture\WPThemePicture
* WaughJ\WPUploadPicture\WPUploadPicture
* WaughJ\WPPostThumbnail\WPPostThumbnail

The regular image shortcode loads the exact source URL given, without a cache-corruption-breaking version parameter. It is mainly for use by other classes, like the next 2.

The regular picture shortcode loads %base%.%ext%, as well as extra sources based on the sizes given. Read https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture for mo’ info on how the picture element works.

The theme image & picture shortcodes load images from the current theme directory.

The upload image & picture shortcodes load images from the uploads directory.

The thumbnail shortcode loads a post’s thumbnail. If the post-id attribute is given, it loads the thumbnail o’ that ID. If no ID is given, it tries to supply the ID o’ whatever the current post is ( whatever get_the_ID() gives ). Img, source, & picture attributes can be given through %tag-name%-%attribute-name%. For example, to set the image’s class, add img-class=”%class%”.

The HTML & Theme classes have near the same interface: a mandatory source & optional arguments. For the shortcodes, this means a “src” attribute as well as any other valid HTML attributes; for the classes, it means a hash map as an optional 2nd argument.

The WPUploadImage class takes a mandatory ID integer representing the ID o’ the image in the media section o’ the WordPress admin, the 2nd argument is an optional size string representing the slug o’ the size type as registered in WordPress, with “responsive” for automatically an image that uses srcset to dynamically load the size for different window sizes, & the optional 3rd argument is a hash map for extra attributes, as ‘bove.

The WPUploadPicture takes a mandatory ID integer & the optional attributes hash map.

In addition to any valid HTML attributes, the WPThemeImage & WPThemePicture classes also accept “directory” & they & the uploads classes accept the “show-version” attributes. The former, if set, will automatically put the source in the given directory; the “show-version” attribute, if set to false, won’t try to find the image’s last modified type to give it a version parameter for breaking cache corruption.

If “alt” attribute is not set, an empty 1 will automatically be added to the HTML generated, ensuring that all images made through these will have an alt tag.

To make working with theme image objects with minimal inconvenience for images that are all in the same directory that is not the topmost directory o’ the theme directory, you can globally set the inner shared directory in the WordPress admin through Appearances -> Theme -> Directories, or directly in PHP with WPThemeImage’s static setDefaultSharedDirectory method on the class itself. After that, all initialized WPThemeImage & WPThemePicture instances, including the shortcodes, will automatically use that shared directory if a different 1 isn’t provided.

To add HTML attributes to WPThemePicture & WPUploadPicture shortcodes, prefix them with “img-“, “picture-“, or “source-” depending on what tag you want the attribute given to. For example, to apply a class to the img tag, give the shortcode the attribute “img-class”.

Examples

use WaughJ\WPUploadImage\WPUploadImage; echo new WPUploadImage ( 31, [ 'class' => 'center-img portrait', 'alt' => 'King' ] ); 

&

[upload-image media-id="31" class="center-img portrait" alt="King"] 

Will generate something like <img class="center-img portrait" alt="King" src="https://www.domain.com/wp-content/uploads/2018/12/demo-150x150.png?m=1543875777" />

use WaughJ\WPThemeImage\WPThemeImage; WPThemeImage::setDefaultSharedDirectory( 'img' ); echo new WPThemeImage( 'photo.jpg' ); 

Will generate something like <img src="https://www.domain.com/wp-content/themes/theme-slug/img/photo.jpg?m=1543875777" alt="" />

[upload-picture media-id="8"] 

Will generate something like <picture><source srcset="https://www.example.com/wp-content/uploads/2018/12/photo-150x150.jpg?m=1543875777" media="(max-width:150px)"><source srcset="https://www.example.com/wp-content/uploads/2018/12/photo-300x300.jpg?m=1543875781" media="(max-width:300px)"><source srcset="https://www.example.com/wp-content/uploads/2018/12/photo-768x768.jpg?m=1543875785" media="(max-width:768px)"><source srcset="https://www.example.com/wp-content/uploads/2018/12/photo-1024x1024.jpg?m=1543875831"><img src="https://www.example.com/wp-content/uploads/2018/12/photo-150x150.jpg?m=1543875777" alt="" /></picture>

For mo’ information on how each class works, check out their documentation @ https://github.com/waughjai?tab=repositories

Pricing

Starting from $0 per month.

Check Out the Image Hotspot Widget

By Common Ninja

Image HotspotTry For Free!

App Info

Rating

Reviewers

No reviews

Tags

html generator
image
loader

Developed By

waughjai

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Image Hotspot for Wordpress logo

Image Hotspot

Add interactive image hotspots to your site to turn static visuals into clickable guided experiences that improve engagement.

Accordion for Wordpress logo

Accordion

Add collapsible content sections to your site to organize information and help users navigate content more efficiently.

Spinning Wheel for Wordpress logo

Spinning Wheel

Add an interactive spinning wheel to offer prizes, capture leads, and drive user engagement through gamified rewards.

Team Members Blobs for Wordpress logo

Team Members Blobs

Use team members blobs to present your staff in a clear, creative format that builds trust, supports transparency, and strengthens brand credibility.

TikTok Feed for Wordpress logo

TikTok Feed

Show your latest TikTok videos in a live feed that keeps content fresh, builds social proof, and keeps visitors engaged.

Card Carousel for Wordpress logo

Card Carousel

Showcase content with a card carousel that combines images and text, improves visual design, and helps visitors explore key information.

Image Carousel for Wordpress logo

Image Carousel

Showcase images with an image carousel that rotates or slides visuals, improves design, and draws attention to key content.

Social Media & RSS Feeds for Wordpress logo

Social Media & RSS Feeds

Add social media and RSS feeds to your site to display fresh content, grow your online presence, and keep visitors engaged with real time updates.

Image Grid Slider for Wordpress logo

Image Grid Slider

Showcase visuals with an image grid slider that blends a grid layout and carousel motion to create a dynamic, customizable, mobile friendly display.

Catalog for Wordpress logo

Catalog

Create and customize product catalogs with a catalog widget that organizes items clearly, improves browsing, and helps visitors explore your offerings easily.

Logo Slider for Wordpress logo

Logo Slider

Add a logo slider to your site to showcase clients and partners, strengthen brand credibility, and build trust with new visitors.

Website Translator for Wordpress logo

Website Translator

Add a translation widget to your site so users can switch languages easily and access content in their preferred language.

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms