Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/jewelmm10/image-voting/archive/refs/heads/master.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Image Contest Voting Plugin
Description
The Image Contest Voting Plugin allows users to create a custom post type for image contests, featuring a voting system. Each post includes a title, featured image (thumbnail), a vote count. Users can vote for their favorite images, and votes are updated dynamically without refreshing the page.
Features
- Custom post type:
Image Contest - Featured image
- Voting system with real-time updates
- Total votes displayed dynamically for each image
- Shortcode to display voting cards
Installation
- Download the plugin files and place them in your WordPress
wp-content/plugins/directory. - Activate the plugin via the WordPress Admin Dashboard under Plugins.
Usage
Adding an Image Contest Post
- Navigate to Image Contest in the WordPress Admin Menu.
- Add a new post.
- Add a title and a featured image.
- Publish the post.
Displaying the Contest
To display the image contest on the frontend:
- Use the shortcode
[icp_voting]in page, or widget. - The voting cards will display with the title, images, vote button, and vote counts.
Shortcode
[icp_voting]
Output
The shortcode displays all image contest posts in a card layout with:
- Title
- Featured image
- Vote button
- Vote count for the image and total votes across all images
JavaScript Features
Real-time vote count updates are handled using AJAX, ensuring a seamless user experience.
File Structure
image-voting-plugin/
├── icp-style.js # Style for voting card design
├── icp-voting.js # Script for handling voting functionality
├── index.php # Plugin main file
├── readme.md # Readme file
Development Notes
- AJAX endpoints are secured with nonces to prevent unauthorized access.
- Fully compatible with WordPress coding standards.