Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Using accordion block to group songs.

  • I have a website that licenses music. I have about 500 songs and each song has about 6-7 alternate mixes for a total of about 4000 songs. They are all separate posts with seven custom fields per post. I use WP All Import to upload all the posts/songs.

    I would like to use the accordion block (or any way) to group the alternate mix posts underneath the Main mix of the song. Is this possible and, if so, would I be able to use WP All Import to update the site.

    An example can be seen here in the first 8 songs returned in this search:
    https://artandrobinsmusic.com/search-results/?_sf_s=drifting

    Thanks for any help.

  • Hi there,

    I would like to use the accordion block (or any way) to group the alternate mix posts underneath the Main mix of the song

    I’m not sure I understand this description, can you explain some more? What do you mean by mix posts and main mix of the song?

  • Doesn’t have to be that color scheme. It’s just an example of the grouping.

  • are all the songs in the screenshot single posts?

    what’s the relationship between the posts?

  • That I don’t know. It’s just an example of what I am trying to achieve. The main mix of the song with the alternate titles grouped under them and collapsible. In that image, the plus sign in the main title indicates there are five alternate mixes in the group. Clicking on the plus signs opens up the accordion to reveal the alternate mixes.

  • Hi there,

    the Accordion block doesn’t do any kind of clever grouping or filtering of content , it simply adds the HTML/CSS/JS to creat the accordion UI/UX.

    I think the main task you have here is about data. How to save the song, how to relate them and lastly how to query and display them

    For example if each song; original or variant was saved as a post type.
    And the post type, had hierarchical args like the Page post type, then you could relate Original and Variant songs like Page Parent and Page Children.

    That would establish the relationship which could be queried in different ways.

    For example an Archie page could retune just Original ( parent ) Posts.
    And a single Original ( Parent ) post could include a query loop to show just its Variant ( children ).

    For an archive that displays Orginals with a “accordion” that expands to show its Variants would require some custom development, as you would need to nest a Loop ( variants ) inside a parent ( original ) loop.

    Of course there are other methods of relating the data, such as custom fields that link posts or using custom fields to just save the variants in the original songs post meta.

    So best to settle how data is going to be stored and related first, and then consider how to display it.

  • Thank you David. Duh, of course, parent and child! Somewhere in my brain, I seem to recall a plugin being able to do just what you described. Thanks again.

  • You’re welcome.
    Let us know if you need assistance with the query loop displaying child posts.

  • Thanks David. That would be wonderful but I wouldn’t want to impose on you as this is probably beyond GeneratePress support.

  • We are happy to help if we can 🙂

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.