• Trusted by 2,250,000+ users
  • 30-Day money back guarantee
  • 15+ years of experience
  • Woocommece, Elementor, Gutenberg, 6+

Custom Posts Accordion

by Darko Gerguric

0 Ratings

Active Installations

10+

Last Update

4 years

Quality

D

Plugin Description

Description
This plugin creates a basic accordion from custom posts.
Fully compatible with WPML, just translate your posts and use shortcodes as explained below.
The plugin currently does not support Woocommerce.
How to use
To use this plugin you need custom post registered.
You may check Post Types to see how to do it.
Example from WP Codex – for testing, copy and paste code below to theme functions.php
add_action( ‘init’, ‘create_post_type’ );
function create_post_type() {
register_post_type( ‘Accordion’,
array(
‘labels’ => array(
‘name’ => __( ‘Accordions’ ),
‘singular_name’ => __( ‘Accordion’ )
),
‘public’ => true,
‘has_archive’ => true,
)
);
}
Add shortcode to page or post where you want to use accordion
If you used code above to create custom posts type you would use following shortcode:
[gw_accordion post_type=”Accordion”]
Optionally, you may add CSS class
[gw_accordion post_type=”Accordion” class=”my_css_class”]
You can also add code to your theme

or with the CSS class

You also may set ordering, default is by ID and Ascending (ASC)
[gw_accordion post_type=”Accordion” class=”my_css_class” order_by=”title” order=”asc”]
Demo
Check Demo
Known Issues
If your theme uses smooth scroll script like this one
jQuery(function() {
jQuery(‘a[href*=”#”]:not([href=”#”]’).click(function() {
if (location.pathname.replace(/^//,”) == this.pathname.replace(/^//,”) && location.hostname == this.hostname) {
var target = jQuery(this.hash);
target = target.length ? target : jQuery(‘[name=’ + this.hash.slice(1) +’]’);
if (target.length) {
jQuery(‘html,body’).animate({
scrollTop: target.offset().top
}, 2000);
return false;
}
}

});

});
You may need to change this line
jQuery(‘a[href*=”#”]:not([href=”#”]’)
To look like this
jQuery(‘a[href*=”#”]:not([href=”#”], a:not([data-toggle])’)
to avoid conflict

Similar Plugins

  • Report Bug
The content on this website originates from various sources. All rights to the original content remain with the respective author. If you believe that your copyrights have been infringed by the use of content on this website, please contact us at info@plugin-guru.com. We will remove the content in question immediately.

This is the heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Regular Price

Free download

Key Features

  • You will be redirected to the retailer

Collections

Create your first Collection

To create a collection, simply click on the symbol on the desired plugin.

You can see this symbol when you move the mouse over the plugin. 

Current Level

Plugin Magican

You have reached 0 views on your collections and are currently Plugin Magican. You magically help people find the right plugins and are a great asset to the community

0 of 500 views reached