Title: Custom Posts Accordion
Author: dakiriki
Published: <strong>1 de Setembro, 2016</strong>
Last modified: 3 de Febreiro, 2020

---

Buscar plugins

Este plugin **non se actualizou en máis de 2 anos**. É posible que xa non sexa compatible
ou mantido por ninguén, ou podes ter problemas de compatibilidade cando se usa con
novas versións de WordPress.

![](https://s.w.org/plugins/geopattern-icon/custom-post-accordion.svg)

# Custom Posts Accordion

 Por [dakiriki](https://profiles.wordpress.org/dakiriki/)

[Descargar](https://downloads.wordpress.org/plugin/custom-post-accordion.zip)

 * [Detalles](https://gl.wordpress.org/plugins/custom-post-accordion/#description)
 * [Valoracións](https://gl.wordpress.org/plugins/custom-post-accordion/#reviews)
 *  [Instalación](https://gl.wordpress.org/plugins/custom-post-accordion/#installation)
 * [Desenvolvemento](https://gl.wordpress.org/plugins/custom-post-accordion/#developers)

 [Soporte](https://wordpress.org/support/plugin/custom-post-accordion/)

## Descrición

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

 1. To use this plugin you need custom post registered.
     You may check [Post Types](https://codex.wordpress.org/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,
          )
        );
      }
    ```

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

    ```
    <?php echo do_shortcode('[gw_accordion post_type="Accordion"');?>
    ```

or with the CSS class

    ```
    <?php echo do_shortcode('[gw_accordion post_type="Accordion" class="my_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

 1. [Check Demo](https://plugins.darkog.pro/custom-post-accordion-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

## Instalación

 1. Extract the downloaded .zip file and upload the extracted folder to the `/wp-content/
    plugins` directory, or install the plugin through the WordPress plugins screen 
    directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress – click on “Activate”
    link below the plugin name

## Preguntas frecuentes

Q: Does plugin support Woocommerce?
 A: No, not right now.

Q: Can I put images in content to show in accordion?
 A: Yes.

Q: Can I use the plugin in a multilanguage setup?
 A: Yes. The plugin is tested 
and confirmed to work with WPML, all you ned to do is to translate your content.

Q: Does plugin support featured images?
 A: No, not right now.

## Comentarios

Non hai recensións para este plugin.

## Colaboradores e desenvolvedores

“Custom Posts Accordion” é un software de código aberto. As seguintes persoas colaboraron
con este plugin.

Colaboradores

 *   [ dakiriki ](https://profiles.wordpress.org/dakiriki/)
 *   [ Darko Gerguric ](https://profiles.wordpress.org/darkogerguric/)

[Traduce “Custom Posts Accordion” ao teu idioma.](https://translate.wordpress.org/projects/wp-plugins/custom-post-accordion)

### Interesado no desenvolvemento?

[Revisa o código](https://plugins.trac.wordpress.org/browser/custom-post-accordion/),
bota unha ollada ao[repositorio SVN](https://plugins.svn.wordpress.org/custom-post-accordion/),
ou subscríbete ao [log de desenvolvemento](https://plugins.trac.wordpress.org/log/custom-post-accordion/)
por [RSS](https://plugins.trac.wordpress.org/log/custom-post-accordion/?limit=100&mode=stop_on_copy&format=rss).

## Rexistro de cambios

#### 1.0

 * Initial release

#### 1.0.1

 * Updated to latest WP and fixed loop reset

#### 2.0

 * Bootstrap is no longer required
 * Various fixes

## Meta

 *  Versión **1.0.0**
 *  Última actualización **Fai 7 anos**
 *  Instalacións activas **10+**
 *  Versión de WordPress ** 4.9.8 ou superior **
 *  Probado ata **5.3.21**
 *  Idioma
 * [English (US)](https://wordpress.org/plugins/custom-post-accordion/)
 * Etiquetas
 * [Accordion](https://gl.wordpress.org/plugins/tags/accordion/)[custom post](https://gl.wordpress.org/plugins/tags/custom-post/)
 *  [Vista avanzada](https://gl.wordpress.org/plugins/custom-post-accordion/advanced/)

## Valoracións

Aínda non se enviaron valoracións.

[Your review](https://wordpress.org/support/plugin/custom-post-accordion/reviews/#new-post)

[Ver todas as valoracións](https://wordpress.org/support/plugin/custom-post-accordion/reviews/)

## Colaboradores

 *   [ dakiriki ](https://profiles.wordpress.org/dakiriki/)
 *   [ Darko Gerguric ](https://profiles.wordpress.org/darkogerguric/)

## Soporte

Tes algo que dicir? Necesitas axuda?

 [Ver o foro de soporte](https://wordpress.org/support/plugin/custom-post-accordion/)

## Doar

Queres apoiar o progreso deste plugin?

 [ Dona a este plugin ](https://www.paypal.me/DarkoG)