Shortcode Plugin
A simple WordPress plugin to demonstrate shortcode functionality.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/kishanvyas308/shortcode-plugin/archive/refs/heads/master.zipA simple WordPress plugin to demonstrate shortcode functionality.
Overview
Shortcode Plugin is a lightweight WordPress plugin created for demonstrating how to build and use shortcodes. It provides two example shortcodes: one for displaying employee information with customizable attributes, and another for listing recent posts dynamically using WP_Query.
Features
- Register custom shortcodes for WordPress.
- Display employee information with customizable name and email.
- List a configurable number of recent posts.
- Clean and simple code for learning or quick use.
Installation
- Download or clone this repository:
git clone https://github.com/KishanVyas308/Shortcode-Plugin.git - Upload the
shortcode-plugin.phpfile to your/wp-content/plugins/directory. - Go to your WordPress admin dashboard, then Plugins > Installed Plugins.
- Activate Shortcode Plugin.
Usage
Employee Shortcode
Displays a styled box with employee name and email.
Shortcode:
[employee name="John Doe" email="john.doe@example.com"]
Parameters:
name(optional): Defaults to "Kishan Vyas"email(optional): Defaults to "kishan.vyas@example.com"
Example Output:
[employee name="Jane Smith" email="jane.smith@example.com"]
List All Posts Shortcode
Displays a list of recent published posts.
Shortcode:
[list-all-posts number="5"]
Parameters:
number(optional): Number of posts to display (default: 4)
Example Output:
[list-all-posts number="3"]
Customization
You can modify the plugin code to add more attributes, change the layout, or register additional shortcodes.
Screenshots
Credits
Developed by Kishan Vyas
License
This project is licensed under the MIT License.