Halloween Sale 15% off Ends in See the plans

Snippet Library

WordPress code snippets, ready to use

3,040 free snippets from the WPIDE team and the community. Copy the code, or add any snippet to your site in one click with WPIDE.

241–264 of 285 snippets “code”

  • PHP Content

    Simple Post Views Counter

    Counts how many times each blog post is viewed, shows the total in a Views column in the posts list and adds a [post_views] shortcode for the front end.

  • PHP Developer

    Simple Site Details Settings Page

    Adds Settings > Site Details where you can store your phone number, address and opening hours once, then show them anywhere with [wpide_site_detail key="phone"].

  • PHP Redirects

    Turns an address such as /app/ into one link for posters and QR codes: iPhone visitors go to the App Store, Android visitors to Google Play and everyone else to a page you choose.

  • PHP Content

    Star Rating Shortcode

    Adds a [star_rating] shortcode that shows a rating such as 4.5 out of 5 as stars, with half stars and a text label for screen readers, for reviews and comparison posts.

  • SCSS Content

    Styled Code Blocks (SCSS)

    Gives code blocks and inline code in your posts a dark, readable style with rounded corners, a monospace font stack and horizontal scrolling for long lines.

  • CSS Forms

    Styles for the WPIDE Form Shortcodes

    Gives the contact, quote, newsletter and other WPIDE form shortcodes a clean, consistent look with full-width fields, clear notices and a solid button that follows your theme colors.

  • PHP Developer

    Subtitle Field for Posts

    Adds a "Subtitle" box to the post editor, saves it securely and provides a [wpide_subtitle] shortcode and a helper to display it in your theme.

  • PHP Block Editor

    Synced Pattern Shortcode

    Adds a [synced_pattern] shortcode that prints a synced pattern (formerly reusable block) anywhere shortcodes work, such as classic widgets, page builders or theme files.

  • PHP Content

    Table From Comma-Separated Text Shortcode

    Adds a [data_table] shortcode that turns comma-separated lines typed between the tags into a clean, accessible HTML table with a header row, which is much quicker than building tables by hand.

  • PHP Archives

    Tag Cloud Shortcode

    Adds a [tag_cloud] shortcode to show a tag cloud inside a page or post, with control over how many tags appear and how large they get.

  • PHP Custom Post Types & Fields

    Team Member Details Meta Box

    Adds job title, email, phone and LinkedIn fields to team member profiles and a [team_details] shortcode that shows them with clickable links.

  • PHP Custom Post Types & Fields

    Team Members Grid Shortcode

    Adds a [team] shortcode that shows team members with photo, name and job title in a responsive grid, optionally filtered by department.

  • PHP Custom Post Types & Fields

    Testimonial Details Meta Box

    Adds fields for the customer name, role, company, website and a 1–5 star rating to testimonials, plus a [testimonial_details] shortcode for the attribution line.

  • PHP Custom Post Types & Fields

    Testimonials Grid Shortcode

    Adds a [testimonials] shortcode that shows testimonials as a responsive grid of quotes with the customer's name, role and star rating.

  • PHP Custom Post Types & Fields

    Testimonials Post Type

    Registers a "Testimonials" post type for customer quotes, kept out of search and without single pages, ready to show with a shortcode or query block.

  • PHP Accessibility

    Text Size Buttons Shortcode

    Adds a [text_size_controls] shortcode with "A-", "A" and "A+" buttons that make the whole site's text smaller or larger for that visitor, remembered on their device.

  • PHP Accessibility

    Text Spacing Toggle for Easier Reading

    Adds a [text_spacing_toggle] shortcode button that increases line height, letter and word spacing to the levels recommended by WCAG, which helps readers with dyslexia or low vision.

Have a snippet worth sharing?

Publish it to the library from WPIDE or right here. Sign in with any WordPress site that runs WPIDE, free or Pro. Public snippets are reviewed by the WPIDE team before they appear.