Lightweight Accordion
Lightweight Accordion plugin for WordPress allows you to add collapse elements to posts using a Gutenberg block or a shortcode (via classic editor). By using the details HTML tag and a few lines of CSS this allows for a javascript-free accordion for minimum page load. Extremely Lightweight (<1kb): Without using Javascript the plugin uses the native details HTML tag and a few lines of code for almost no impact on front-end. Customizable: Options include customizing the HTML tag used for the accordion title, open by default, borders, colors, and accordion grouping (auto-close others when one opens). Shortcode Usage examples Here are a few examples of using the accordion plugin with shortcodes. [lightweight-accordion title="My Accordion"]My Content[/lightweight-accordion] Additionally you can display the accordion open on load with the accordion_open option. [lightweight-accordion title="My Accordion" accordion_open=true]My Content[/lightweight-accordion] You can also change the html tag wrapping the title of the accordion using the title_tag option. [lightweight-accordion title="My Accordion" title_tag="h3"]My Content[/lightweight-accordion] If you want to include FAQ schema you can add the schema option and set it to faq. [lightweight-accordion title="What is your return policy?" schema="faq"]You have 1 week to return your items[/lightweight-accordion] If you’d like put a border around the content of the accordion you can use the “bordered” attribute. [lightweight-accordion title="Bordered Content" bordered=true]My Content[/lightweight-accordion] If you want accordions to auto-close when another opens (exclusive accordion), use the “group” attribute with the same value on each accordion. [lightweight-accordion title="Question 1" group="faq"]Answer 1[/lightweight-accordion] [lightweight-accordion title="Question 2" group="faq"]Answer 2[/lightweight-accordion] [lightweight-accordion title="Question 3" group="faq"]Answer 3[/lightweight-accordion] If you’d like to swap the default triangle marker for a chevron or plus/minus icon (optionally on the right side of the title) use the “icon” and “icon_position” attributes. [lightweight-accordion title="My Accordion" icon="chevron" icon_position="right"]My Content[/lightweight-accordion] Shortcode Options Here is the full listing of shortcode options. Additionally all of these options are accessible when using the Gutenberg block. title (Required Default: null) The title of your accordion will be displayed at the top for users to click. A good example would be to include a user’s question so they could click it for more details. content (Required Default: null) Content that will go into your accordion element. title_tag (Default: “span”) This sets the html tag that wraps the title in the accordion summary. Useful if you want to make it a heading tag for SEO purposes. accordion_open (Default: false) Set this to true if you want your accordion to be open by default. bordered (Default: false) Set this to true if you want a border around the accordion content. title_text_color (Default: false) Set this to a hex value or CSS color to change the color of the accordion title text. title_background_color (Default: false) Set this to a hex value or CSS color to change the color of the accordion title text. schema (Default: false) Set this to faq if you’d like FAQ schema to be included. class (Default: false) Used to add a custom class to the parent container of the accordion. anchor (Default: null) Adds the value as an ID to the accordion div as an anchor. autop (Default: true) By default the shortcode will wrap text in a ‘p’ tag. Set this to false if you’d like this disabled for the specific accordion. group (Default: false) Set this to a group name to make accordions with the same group auto-close when another opens. Uses the native HTML details name attribute for zero JavaScript overhead. icon (Default: false) Set this to “chevron”, “plus”, or “none” to replace the default triangle marker. The chevron rotates and the plus becomes a minus when the accordion opens. icon_position (Default: false) Set this to “right” to display the chevron or plus icon on the right side of the accordion title. Additional Details If you’d like to remove the “lightweight-accordion.css” from being enqueued on your site use the filter below. It’s recommend you style the accordion yourself if you use this filter. add_filter('lightweight_accordion_include_frontend_stylesheet', '__return_false' ); If you’d like to remove the “lightweight-accordion/editor-styles.css” from being enqueued in the admin area of your site you can use the filter below. add_filter('lightweight_accordion_include_admin_stylesheet', '__return_false' ); If you’d like to remove processing of shortcodes in accordion content you can use this filter. add_filter('lightweight_accordion_process_shortcodes', '__return_false' ); If you’d like to use inline Microdata for FAQ schema you can use this filter. (Not recommended) add_filter('lightweight_accordion_output_microdata', '__return_true' ); If you’d like to force “lightweight-accordion.css” to load on all of your site you can use this filter. By default the plugin will detect if the block or shortcode is used and enqueue the CSS. add_filter('lightweight_accordion_always_include_frontend_stylesheet', '__return_true' ); When a page contains an accordion a tiny inline script is added to the footer that automatically opens accordions targeted by a URL hash (for example a link to an accordion’s anchor). If you’d like to disable this you can use the filter below. add_filter('lightweight_accordion_anchor_script', '__return_false' );
Top keywords
- accordion39×4.31%
- title23×2.54%
- lightweight-accordion21×2.32%
- default20×2.21%
- filter13×1.44%
- content11×1.22%
- false10×1.11%
- set10×1.11%
- tag10×1.11%
- add9×1.00%
- default false9×1.00%
- faq9×1.00%
PDF Embedder – PDF Viewer & Embed PDF Files for WordPress
Upload PDF files and embed them directly into your site’s posts and pages, as simply as adding images. Each document displays right where you place it, at its natural size or a width you choose, and the responsive viewer adapts automatically whenever the browser dimensions change. Out of the box, WordPress turns an uploaded PDF into a bare download link: visitors click it and leave your page, or the file opens in a viewer you don’t control. PDF Embedder keeps them reading on the page and keeps you in control of how your document looks. PDF Embedder displays PDF documents on more than 300,000 websites. It differs from other PDF plugins in how the document becomes part of the page: rendered inline, sized to your layout, served entirely from your own site, and previewed live while you edit. There is no Google Docs Viewer or other third-party service involved, and the viewer loads its files only on pages that contain a PDF, so the rest of your site stays fast. In the Block Editor, the PDF Embedder block shows a live preview of your document while you edit. Pick a PDF file from the block sidebar, change a setting, and the preview updates to match what visitors will see on the front end. What can you embed? Any PDF file, whether it lives in your Media Library or in another folder on your site. Embed unlimited PDFs across posts, pages, and custom post types. Site owners use PDF Embedder to display: Restaurant menus and price lists Ebooks, guides, whitepapers, and research reports Product catalogs, brochures, and lookbooks Newsletters, magazines, and annual reports User manuals and technical documentation Worksheets, lesson plans, and other course materials Sheet music, church bulletins, and event programs Real estate flyers, floor plans, and legal documents Resumes and portfolios Visitors read the document right on the page: no new tab, no forced download, and no Adobe Acrobat or third-party account required. How it works Upload a PDF to your Media Library, or copy the URL of a PDF hosted anywhere else. Add the PDF Embedder block and pick the file from the block sidebar. In the Classic Editor or a page builder, use the shortcode instead. Publish. Visitors turn pages with the Next and Previous buttons and zoom in when part of a page is too small for their screen. The shortcode works anywhere shortcodes do: [pdf-embedder url="https://example.com/wp-content/uploads/2024/01/Plan-Summary.pdf"] Site-wide defaults, such as width and toolbar position, live under Settings -> PDF Embedder, and any single embed can override them with its own block settings or shortcode attributes. See the Plugin Instructions for sizing options and other ways to customize. Works with membership, e-commerce, and course plugins PDF Embedder renders through a regular shortcode and block, so the viewer works anywhere your post content does, including pages that other plugins restrict or sell access to. Sell access to premium PDF content, such as ebooks, reports, or research papers, by embedding it on pages protected with MemberPress, Paid Memberships Pro, Restrict Content Pro, or WooCommerce Memberships. Deliver handouts and workbooks inside courses built with LearnDash, LifterLMS, or Tutor LMS. Show a free sample chapter on a WooCommerce or Easy Digital Downloads product page, and deliver the full ebook after purchase. Embed several PDFs on one page to build a simple PDF document library for your team, school, or members. On the Pro plan of PDF Embedder Premium, you can pair restricted pages with the secure viewer and watermarks, so members read documents online while the original file stays hard to download. What users say Site owners tend to stay with PDF Embedder for years. Here is what they say: “One client wanted to display PDF newsletters in a way that was clean, user-friendly, and easy to scroll through. That’s when I discovered WP PDF Embedder. It does the job beautifully, making PDFs look professional and effortless to navigate. Since then, it has become my go-to recommendation for any client who needs to showcase PDF content on their website.” — Vera Schafer “I have been using PDF Embedder for well over ten years. It’s just a great app. Can’t recommend it enough.” — Rich Calo “I have been using this plugin (both the free version and the pro version) for a number of years on various clients’ websites. It is easy to set up, does what it needs to and just works the way a plugin should. I highly recommend it.” — DebsWebs “I’ve been using PDF Embedder Secure for 3 years now, and it helped me sharing my paid content securely, preventing malicious people from buying my PDF files and then sharing them illegally everywhere. PDF files are chopped, digested, watermarked, unaccessible even if someone finds the direct link.” — Daniele Benedettelli Go further with PDF Embedder Premium In the free plugin, there is no download button and links inside the PDF are not clickable – the viewer is intentionally simple to fulfill the “read online” goal. PDF Embedder Premium adds those and more: Download button in the toolbar, so visitors can save your document for later. Working hyperlinks, both within the document and out to any other page. Continuous scroll – readers scroll through pages naturally instead of clicking through them. Mobile-friendly full screen mode – when the document renders narrower than a width you set, as it does on most phones, it displays as a thumbnail with a large “View in Full Screen” button. The document opens with the full focus of the mobile browser, and readers swipe between pages instead of clicking buttons. Jump to page – type a page number in the toolbar to go straight there. Full-text search – visitors search the text of your PDF documents from the toolbar and jump straight to matching pages. View and download tracking – see which documents people actually read. Elementor widget with the same options as the block and a live PDF preview in the Elementor editor. Secure viewing (Pro plan) – the PDF is encrypted during transmission, so it is difficult for a casual user to save or print the original file, and your document is far less likely to end up outside your site. Watermarks (Pro plan) – overlay any text, including the logged-in user’s name or email address, to discourage sharing of screenshots. Automatic PDF thumbnails (Elite plan) – every PDF in your Media Library gets an image thumbnail to use as a featured image, a clickable download link, or the file’s icon in the Media Library. Every plan comes with a 14-day money-back guarantee: if Premium is not a fit, you get a refund, no questions asked. Compare Premium plans on wp-pdf.com Better than Google Drive embeds, Scribd, Issuu, and other PDF tools The usual ways to embed a PDF without a plugin – an iframe snippet, the Google Drive or Google Docs viewer, or a service like Scribd, Issuu, FlippingBook, FlipHTML5, or DocDroid – hand your document to servers you don’t control. It loads at their speed, carries their branding, and can disappear or change terms at any time. You may have also tried other WordPress PDF plugins, such as EmbedPress, Embed Any Document, PDF Poster, Wonder PDF Embed, PDF.js Viewer, or flipbook plugins like DearFlip and 3D FlipBook. Most rely on iframes or third-party viewers to display the document. PDF Embedder keeps everything on your own site: your files, your server, your data. That is better for page speed, better for privacy, and more reliable for your visitors. With thanks to the Mozilla team for developing the underlying pdf.js technology used by this PDF viewer plugin. Branding guidelines PDF Embedder is a product of wp-pdf.com. When writing about this WordPress PDF plugin, please use the correct branding: PDF Embedder (correct) PDFEmbedder (incorrect) PDF Embeder (incorrect) PDF Imbedder (incorrect)