Site logo

Archived topic

How to install code from Github

4 replies · Started by Mark on June 3, 2022

Viewing posts 1–5 of 5

Hi Mark,

Unfortunately, we cannot help with custom solutions created by other users. This could become an issue if the solution doesn't work or creates incompatibility down the road.

Can you try posting a comment on his YouTube video and see if he is able to help?
I see two comments for that video and he replied to both of them.

I also recognize the user and his name is Elvis Krstulović. He is very active in our Facebook group GeneratePress community and this was one of his posts:
https://www.screencast.com/t/y9GL09Hq

Thank you for your understanding.

Hello Mark, Leo,
I will gladly help.

The solution consists of three files.

A php function to register (load) the files necessary.
The JS file that provides a toggle functionality.
The CSS file that styles the accordion to your liking.

The way it works is basically in two ways:
1. if you use snippets, or wpcodebox plugin, just ignore the php file and include the js and css file there.
2. if you do not use these plugins, but instead use GP child theme, then include the https://gist.github.com/thisbit/4c1d3f599d5b0b419bda3d3699b20e08#file-enqueue_accordion_assets-php functions in your functions.php.

Also create folder assets, then inside folders named js and css, and save accordion.js and accordion.css files in these folders.
You can also change the names of these folders or files, just make sure to account for that in the functions that loads them.

When you have this working/loading, the you can easily follow the rest of the video.

If any more questions, post on my youtube channel as Leo suggested. I will be glad to help.
Best,
Elvis

Thanks Elvis :)

Thanks Elvis!

This archived topic is closed to new replies.