Halloween Sale 15% off Ends in See the plans

Snippet Library

Custom Post Types & Fields snippets for WordPress

Snippets for custom post types, taxonomies and custom fields: register a post type, add meta boxes, show fields in lists and archives. For developers modeling content beyond posts and pages.

1–24 of 33 snippets “shortcode”

  • PHP Custom Post Types & Fields

    ACF Image Field Shortcode

    Adds an [acf_image name="hero" size="large"] shortcode that outputs a responsive image from an ACF image field, whatever return format the field uses.

  • PHP Custom Post Types & Fields

    Adds an [acf_button name="cta"] shortcode that renders an ACF link field as a theme-styled button, respecting the "open in new tab" choice.

  • PHP Custom Post Types & Fields

    Book Details Meta Box

    Adds author, ISBN, publisher, publication date, page count and a buy link to books, plus a [book_details] shortcode.

  • PHP Custom Post Types & Fields

    Event Details Meta Box

    Adds an "Event details" box (start, end, venue, address, price, attendance mode and ticket link) to events, saved securely, plus an [event_details] shortcode to display them.

  • SCSS Custom Post Types & Fields

    FAQ Accordion Styles (SCSS)

    Styles collapsible FAQ items (from the FAQ list and ACF FAQ shortcodes, or any Details block) with dividers, a plus/minus marker and a visible keyboard focus ring.

  • PHP Custom Post Types & Fields

    Job Details Meta Box

    Adds employment type, salary range, location, remote option, closing date and apply link to job listings, plus a [job_details] shortcode.

  • PHP Custom Post Types & Fields

    List Posts by an ACF Field Value

    Adds an [acf_posts field="featured" value="1"] shortcode that lists posts whose ACF field matches a value, such as featured items or posts for a region.

  • PHP Custom Post Types & Fields

    Location Details Meta Box

    Adds address, phone, opening hours and map coordinates to locations and a [location_details] shortcode with a click-to-call link and directions.

  • PHP Custom Post Types & Fields

    Post Type Grid Shortcode

    Adds a [post_grid type="..."] shortcode that shows any post type as a responsive grid of cards with image, title and excerpt, so a regular page can act as its archive.

  • PHP Custom Post Types & Fields

    Property Details Meta Box

    Adds price, bedrooms, bathrooms, floor area and address fields to property listings and a [property_details] shortcode that shows them as a fact list.

  • PHP Custom Post Types & Fields

    Published Item Count Shortcode

    Adds a [post_count type="job"] shortcode that prints how many published items a post type has, for lines like "We have 12 open positions".

  • PHP Custom Post Types & Fields

    Recipe Details Meta Box

    Adds prep and cook times, servings, calories, ingredients and steps to recipes, plus a [recipe_card] shortcode that prints a tidy recipe card.

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.