Halloween Sale 15% off Ends in See the plans

Snippet Library

Content snippets for WordPress

Snippets that add to or change your posts and pages: reading time, author boxes, “last updated” notes, content after the post or after a paragraph, and excerpt tweaks. For bloggers, publishers and anyone who wants richer posts without editing theme files.

25–48 of 49 snippets “code”

  • PHP Content

    Registers a [login_logout_link] shortcode that shows "Log in" to visitors and "Log out" to logged-in users, returning them to the same page.

  • PHP Content

    Notice Box Shortcode

    Adds a [notice] shortcode for colored info, success, warning and error boxes that make tips and important warnings stand out in your content.

  • PHP Content

    PDF Viewer Shortcode

    Adds a [pdf_viewer] shortcode that shows a PDF from the Media Library or a URL inside the page with the browser's built-in viewer, plus a download link for phones that cannot display it inline.

  • PHP Content

    Print Button Shortcode

    Adds a [print_button] shortcode that places a button visitors can click to print the current page, useful for recipes, guides and forms.

  • PHP Content

    Pull Quote Shortcode

    Adds a [pull_quote] shortcode that sets a short quotation in large type, floated to the side on wide screens and full width on phones, to break up long articles.

  • PHP Content

    Random Posts Shortcode

    Adds a [random_posts] shortcode that lists a few random posts, optionally from chosen categories or another post type, without running a slow random database query on every page view.

  • PHP Content

    Reading Time Shortcode

    Registers a [reading_time] shortcode that shows an estimated reading time such as "4 min read" for the current post.

  • PHP Content

    Recent Posts Shortcode

    Adds a [recent_posts] shortcode that lists your latest posts anywhere, optionally from one category and with dates.

  • PHP Content

    Recently Updated Posts Shortcode

    Adds a [recently_updated] shortcode that lists the posts most recently revised, with the date they were updated, to show readers that older guides are being kept fresh.

  • PHP Content

    Responsive Columns Shortcode

    Adds [layout_columns] and [layout_col] shortcodes that place content side by side in two, three or four columns and stack them on phones, for classic editor content and page builders without a columns tool.

  • PHP Content

    Show Content Between Two Dates

    Adds a [scheduled] shortcode that shows the text inside it only from a start date, until an end date, or between both. Ideal for limited offers and event notices.

  • 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 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.

  • 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 Content

    Time-of-Day Greeting Shortcode

    Adds a [greeting] shortcode that says Good morning, Good afternoon or Good evening based on your site's timezone, with the logged-in user's first name when there is one.

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.