Skip to content

Instantly share code, notes, and snippets.

Avatar

Statsy Tepluypled

View GitHub Profile
View alt text
<img scr="/theme.png" alt="The Monstroid2" />
View google fonts
function myprefix_enqueue_google_fonts() {
wp_enqueue_style( 'Trade Winds', 'https://fonts.googleapis.com/css?family=Trade+Winds&display=swap' );
}
add_action( 'wp_enqueue_scripts', 'myprefix_enqueue_google_fonts' );
View wp_enqueue_style
function custom_add_google_fonts() {
wp_enqueue_style( 'custom-google-fonts', 'https://fonts.googleapis.com/css?family=Trade+Winds&display=swap', false );
}
add_action( 'wp_enqueue_scripts', 'custom_add_google_fonts' );
View Add to your .htaccess file
<IfModule mod_substitute.c>
SubstituteMaxLineLength 30m
</IfModule>
LimitRequestBody 9999999
View Style for paragraph
<style>
body p {
background-color: #DAF7A6;
color: #340E6E;
font-family: Times-New-Roman;
text-align: center;
padding: 5px;
}
</style>
View Add code to .htaccess
<IfModule mod_substitute.c>
SubstituteMaxLineLength 30m
</IfModule>
LimitRequestBody 9999999
View add_compatibility_elementor_page_templates
public function add_compatibility_elementor_page_templates() {
$page_templates_module = Elementor\Plugin::$instance->modules_manager->get_modules( 'page-templates' );
add_filter( 'template_include', array( $page_templates_module, 'template_include' ), 100 );
}
View custom.php
<?php
function loadMyBlockFiles() {
wp_enqueue_script(
'my-test-text',
plugin_dir_url(__FILE__). 'custom.js',
array('wp-blocks', 'wp-i18n', 'wp-editor'),
true
);
}
View custom.js
registerBlockType('namespace/block-slug', {
//built-in attributes
title: 'The name',
description: 'Block to generate a custom event',
icon: 'format-image',
category: 'layout'
//custom attributes
attributes: {