This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function defer_vidbgpro_vimeo() { | |
/** | |
* As of WP 6.3, you can specify an array of args instead of the boolean for in_footer. | |
* These args can provide an optional strategy: blocking, defer, or async. | |
* @link https://make.wordpress.org/core/2023/07/14/registering-scripts-with-async-and-defer-attributes-in-wordpress-6-3/ | |
*/ | |
wp_enqueue_script( | |
'vidbgpro-vimeo', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { gql, useQuery } from '@apollo/client'; | |
import { getApolloAuthClient, useAuth } from '@faustwp/core'; | |
import { useRouter } from 'next/router'; | |
function AuthenticatedView(props) { | |
const { | |
query: { typeName, p }, | |
} = useRouter(); | |
const client = getApolloAuthClient(); | |
const postType = typeName.toLowerCase(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { gql, useQuery } from '@apollo/client'; | |
import { getNextStaticProps } from '@faustwp/core'; | |
/** | |
* How many posts you want to display per page | |
*/ | |
export const POSTS_PER_PAGE = 2; | |
/** | |
* Calculates the "offset" by multiplying |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="made-in-ny"></div> | |
<script src="https://player.vimeo.com/api/player.js"></script> | |
<script> | |
var options = { | |
url: 'https://vimeo.com/272406014', | |
width: 640, | |
loop: true, | |
autoplay: true, // Notice autoplay is enabled. | |
muted: true, // The video has been muted due to new Chrome/Safari autoplay conditions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add a video background to every page/post | |
* | |
* @version 05222018 | |
* @author Push Labs | |
* @link https://pushlabs.co | |
*/ | |
function theme_prefix_vidbg_every_page() { | |
// Add [vidbg] params as needed. Be sure to change the container to your desired container. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change Video Background "Tap to unmute" text | |
* | |
* @since 2.7.0 | |
* @author Push Labs | |
* @param String $text The button text | |
* @return String $text | |
*/ | |
function themeprefix_vidbg_tap_to_unmute_text( $use_old ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Use Video Background Pro's old integrations data model (not recommended) | |
* | |
* @since 3.0.0 | |
* @author Push Labs | |
* @param Boolean $is_enabled Boolean decisison to enable/disable the integration | |
* @return Boolean $is_enabled | |
*/ | |
function themeprefix_vidbgpro_integrations_use_old_data_model( $use_old ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Disable Video Background Pro's SiteOrigin Page Builder Integration | |
* | |
* @since 3.0.0 | |
* @author Push Labs | |
* @param Boolean $is_enabled Boolean decisison to enable/disable the integration | |
* @return Boolean $is_enabled | |
*/ | |
function themeprefix_vidbgpro_disable_siteorigin( $is_enabled ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Randomize a list of YouTube videos for a video background through Video Background Pro | |
* | |
* @var Array $youtube_url_list an array of YouTube URLs | |
* @var String $url The random YouTube URL | |
* @var String $shortcode The [vidbg] shortcode. Make sure to use $url for the $youtube_url | |
* | |
* @link https://pushlabs.co/docs/video-background-pro/#using-the-shortcode | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Play the video background | |
$( '#container' ).data( 'vidbgpro' ).playVidbg(); | |
// Pause the video background | |
$( '#container' ).data( 'vidbgpro' ).pauseVidbg(); | |
// Mute the video background | |
$( '#container' ).data( 'vidbgpro' ).muteVidbg(); | |
// UnMute the video background |
NewerOlder