- Add your query block, and give it a class of
is-style-carousel
. - Add the code from block-editor.php somewhere such as your child theme functions.php file.
- Configure Splide options in the
query_carousel_block_init()
function.
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 | |
// This filter specifically checks whether a theme has a `changelog` template. | |
// If not, it looks for a fallback template in the plugin. | |
add_filter( 'template_include', function( $template ) { | |
// I'm just testing a query string here for demonstration/testing | |
// purposes, but you'll want to add a check for your registered query | |
// var with WordPress. For now, you can test with `?changelog=anything`. | |
if ( ! isset( $_GET['changelog'] ) ) { |
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 | |
/** | |
* Plugin Name: Content Security Policy | |
* Version: 1.0.0 | |
* Description: Adds a Content-Security-Policy header to all non-admin requests. | |
* License: GNU General Public License v2 | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
* Original Inspiration: https://gist.github.com/westonruter/c8b49406391a8d86a5864fb41a523ae9 | |
*/ |
This is a WordPress Plugin that improves the default sizes attribute calculation for images.
WPP Better Image Sizes is a WordPress plugin that provides a better calculation for the default sizes attribute for images. This plugin is designed to enhance the performance and responsiveness of your WordPress site.
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
/** | |
* WordPress Dependencies | |
*/ | |
import { | |
useBlockProps, | |
useBlockEditingMode, | |
RichText, | |
store as blockEditorStore, | |
} from '@wordpress/block-editor'; | |
import { useSelect } from '@wordpress/data'; |
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 | |
class CacheOptionPerPage { | |
private static $conditional_options_context; | |
private static $alloptions_names = array(); | |
private static $alloptions_used = array(); | |
private static $current_context; |
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 | |
$args = [ | |
'post_type' => 'post', | |
'posts_per_page' => -1, | |
'post_status' => 'any', | |
'meta_query' => [ | |
[ | |
'key' => 'hide_thumbnail', | |
'compare' => 'EXISTS' |
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 get_page_by_title( $page_title, $output = OBJECT, $post_type = 'page' ) { | |
$query = new WP_Query( | |
array( | |
'post_type' => $post_type, | |
'title' => $page_title, | |
'post_status' => 'all', | |
'posts_per_page' => 1, | |
'no_found_rows' => true, | |
'ignore_sticky_posts' => true, |
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
#!/usr/bin/php | |
<?php | |
declare(strict_types = 1); | |
// require_once ('hhb_.inc.php'); | |
hhb_init (); | |
if ($argc !== 3) { | |
fprintf ( STDERR, "usage: %s timestamp url\n", $argv [0] ); | |
fprintf ( STDERR, "example: %s 20091012061648 http://www.p4w.se\n", $argv [0] ); | |
die ( 1 ); | |
} |
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 | |
/** | |
* Optimize Loading Separate Core Block Assets in Classic Themes Plugin. | |
* | |
* @package OptimizeLoadingSeparateCoreBlockAssetsInClassicThemes | |
* @author Weston Ruter | |
* @link https://gist.github.com/westonruter/25187db63a7666f08b151ca53497ffb5 | |
* @license GPL-2.0-or-later | |
* @copyright 2023 Google Inc. | |
* |
NewerOlder