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
/** | |
* Show only MAX_DOTS in Splide Pagination. | |
* | |
* This code generates a custom pagination. | |
* Therefore you need to disable the Splide pagination with the option `pagination: false`. | |
* You can configure the number of visible pagination dots via MAX_DOTS. | |
* The active dot is moved from left to right and starts at the left if the end of | |
* MAX_DOTS is reached. So the user can see that there is something happen when using the Slider. | |
*/ |
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 | |
namespace Bricks; | |
class MWE_BRICKS_SIGN_CODE | |
{ | |
public function __construct() { | |
if (defined('WP_CLI') && WP_CLI) { | |
// https://make.wordpress.org/cli/handbook/references/internal-api/wp-cli-add-command/ | |
\WP_CLI::add_command('bricks', '\Bricks\MWE_BRICKS_SIGN_CODE'); | |
} |
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
const updateActiveEl = (list) => { | |
if (!list) return; | |
var hash = window.location.hash; | |
if (!hash) { | |
let first = list.querySelector("a"); | |
if (first) { | |
first.classList.add("active"); | |
} | |
return; | |
} |
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 | |
/** | |
* helper function to test if post is in subcategory | |
*/ | |
if (!function_exists("mwe_is_in_subcategory")) { | |
function mwe_is_in_subcategory($categories, $_post = null) | |
{ | |
foreach ((array) $categories as $category) { | |
$subcats = get_term_children((int) $category, "category"); |
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 | |
// Include only terms where posts do have a term from custom 'hersteller' taxonomy | |
add_filter( | |
"bricks/terms/query_vars", | |
function ($query_vars, $settings, $element_id) { | |
if ($element_id !== "qaajzi") { | |
return $query_vars; | |
} |
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 | |
// Load ACSS Gutenberg editor styles | |
function mwe_acss_gutenberg_styles() { | |
$url = site_url( '/wp-content/uploads/automatic-css/'); | |
wp_enqueue_style( 'mwe-acss-gutenberg', $url . 'automatic-gutenberg-editor.css', false, '1.0', 'all' ); | |
} | |
add_action( 'enqueue_block_editor_assets', 'mwe_acss_gutenberg_styles' ); |
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
/** | |
* FAQ Schema.org for MetaBox Relationship if manual FAQ Schema is active | |
* | |
* @See https://www.seopress.org/support/hooks/filter-manual-faq-schema/ | |
*/ | |
add_filter('seopress_pro_get_json_data_faq','sp_pro_schema_faq_json', 10, 2); | |
function sp_pro_schema_faq_json($json, $context) | |
{ | |
$relationship_id = 'faq-page'; // Replace with your Relationship ID |
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 year_shortcode () { | |
$year = date_i18n ('Y'); | |
return $year; | |
} | |
add_shortcode ('year', 'year_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
<?php | |
add_theme_support( 'post-thumbnails' ); | |
add_image_size( 'image-480', 480, 0 ); | |
add_image_size( 'image-640', 640, 0 ); | |
add_image_size( 'image-720', 720, 0 ); | |
add_image_size( 'image-960', 960, 0 ); | |
add_image_size( 'image-1168', 1168, 0 ); | |
add_image_size( 'image-1440', 1440, 0 ); | |
add_image_size( 'image-1920', 1920, 0 ); |
NewerOlder