Skip to content

Instantly share code, notes, and snippets.

@Kevin-LeMasters-PixelParade
Kevin-LeMasters-PixelParade / _BeaverBuilder-Scrollspy-Bootstrap.md
Last active April 16, 2024 12:49
Easy Scrollspy setup for BB theme users running full Bootstrap 4 or anyone using Bootstrap 4 with/without BB

Easy Scrollspy setup for BB theme users running full Bootstrap 4 or anyone using Bootstrap 4 with BB.

For BB theme, enable full bootstrap 4 under customize > General > Layout (Or load it from CDN on a single page if not using it sitewide)

JS file add to BB page JS directly or load via external file in footer defered.

Currently using it with PowerPack's Table of Contents module, but this could be used for any list/menu of links, just change the data-target attribute.

I referred to this documentation when setting up

@nathan-roberts
nathan-roberts / query.php
Created November 8, 2022 02:09
Query posts by users roles
<?php
/**
* Get all the user ID's for the specified user roles
*
* @param array $role
* @return array User ID's
*/
function get_all_user_ids_by_user_roles($role)
{
@techjewel
techjewel / fluentform-submission-success.js
Last active September 14, 2023 13:42
Form submission success JS Event in Fluent Forms
// Event on form submission success
// You can paste this script to Form's custom JS Box
$form.on('fluentform_submission_success', function() {
// You can run your own JS and will be run on successful form submission
});
@ffoodd
ffoodd / improved-sr-only.markdown
Last active April 11, 2024 22:55
Improved .sr-only

Improved .sr-only

Theorically bulletproof CSS class for visually hide anything and keep it accessible to ATs.

A Pen by ffoodd on CodePen.

License.

@thierrypigot
thierrypigot / scripts.js
Last active July 6, 2023 19:26
[Beaver Builder] Highlight menu links on a One Page with anchor links and sections detection on scroll
(function($){
$(document).ready(function(){
/**
* This part handles the highlighting functionality.
* We use the scroll functionality again, some array creation and
* manipulation, class adding and class removing, and conditional testing
*/
var aChildren = $("header ul.menu li").children(); // find the a children of the list items
@protrolium
protrolium / YouTube API — getting video thumbnail
Created February 5, 2014 19:57
YouTube API — getting video thumbnail
Each YouTube video has 4 generated images. They are predictably formatted as follows:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg