image: path: /assets/img/img_name alt: image_alt.
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
{% if template contains 'collection' and current_tags %} | |
<meta name="robots" content="noindex" /> | |
<link rel="canonical" href="{{ shop.url }}{{ collection.url }}" /> | |
{% else %} | |
<link rel="canonical" href="{{ canonical_url }}" /> | |
{% endif %} |
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
add_filter( 'gform_submit_button', 'add_custom_css_classes', 10, 2 ); | |
function add_custom_css_classes( $button, $form ) { | |
$dom = new DOMDocument(); | |
$dom->loadHTML( $button ); | |
$input = $dom->getElementsByTagName( 'input' )->item(0); | |
$classes = $input->getAttribute( 'class' ); | |
$classes .= " btn btn--primary"; | |
$input->setAttribute( 'class', $classes ); | |
return $dom->saveHtml( $input ); | |
} |
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
// Get all elements with the class "pop-action" | |
const buttons = document.querySelectorAll('.pop-action'); | |
// Iterate through the NodeList of buttons and attach click event listeners | |
buttons.forEach(function(button) { | |
button.addEventListener('click', function() { | |
// Code to run when a button is clicked | |
console.log(`Button "${button.textContent}" clicked.`); |
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
{% set block_name = "example_class" %} | |
{% set classes = [ | |
'paragraph', | |
'paragraph--type--' ~ paragraph.bundle|clean_class, | |
view_mode ? 'paragraph--view-mode--' ~ view_mode|clean_class, | |
not paragraph.isPublished() ? 'paragraph--unpublished', | |
block_name | |
] %} | |
{% block paragraph %} | |
{% block content %} |
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
add_filter( 'gform_submit_button', 'add_custom_css_classes', 10, 2 ); | |
function add_custom_css_classes( $button, $form ) { | |
$dom = new DOMDocument(); | |
$dom->loadHTML( $button ); | |
$input = $dom->getElementsByTagName( 'input' )->item(0); | |
$classes = $input->getAttribute( 'class' ); | |
$classes .= " my-custom-class another-one"; | |
$input->setAttribute( 'class', $classes ); | |
return $dom->saveHtml( $input ); | |
} |
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 agent_notification( $notification, $form) { | |
//This example is using a form with the id of 1 | |
if($form["id"] == 4){ | |
global $post; | |
//the example email is stored in a post meta field called "_cmb_email" | |
//$agent_email = get_post_meta( $post->ID , '_cmb_email', true ); | |
$agent_email = get_field('agent_email'); | |
$notification['to'] = $agent_email; |
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
add_filter( 'wpseo_schema_graph_pieces', 'yoast_add_graph_pieces', 11, 2 ); | |
//sample adding the person content type | |
/** | |
* Adds Schema pieces to our output. | |
* | |
* @param array $pieces Graph pieces to output. | |
* @param \WPSEO_Schema_Context $context Object with context variables. | |
* |
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
/* -------------------------------------------------------------------------------------------------------- */ | |
/* Customize HTML Compression */ | |
/* -------------------------------------------------------------------------------------------------------- */ | |
class WP_HTML_Compression | |
{ | |
// Settings | |
protected $compress_css = true; | |
protected $compress_js = true; | |
protected $info_comment = 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
// Register Custom Post Type | |
function slider() { | |
$labels = array( | |
'name' => _x( 'Post Types', 'Post Type General Name', 'Post Types' ), | |
'singular_name' => _x( 'Post Type', 'Post Type Singular Name', 'Post Types' ), | |
'menu_name' => __( 'Post Types', 'Post Types' ), | |
'name_admin_bar' => __( 'Post Type', 'Post Types' ), | |
'archives' => __( 'Item Archives', 'Post Types' ), | |
'parent_item_colon' => __( 'Parent Item:', 'Post Types' ), | |
'all_items' => __( 'All Items', 'Post Types' ), |
NewerOlder