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 is useful for when you would like to get the event ID but only have the product object in WooCommerce. | |
// For example, you would like to get the event ID from an order line item. | |
$product_id = $product->get_id(); | |
$ticket_meta = get_post_meta( $product_id ); | |
$event_id = absint( $ticket_meta['_tribe_wooticket_for_event'][0] ); |
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
# This is a template .gitignore file for git-managed WordPress projects. | |
# | |
# Fact: you don't want WordPress core files, or your server-specific | |
# configuration files etc., in your project's repository. You just don't. | |
# | |
# Solution: stick this file up your repository root (which it assumes is | |
# also the WordPress root directory) and add exceptions for any plugins, | |
# themes, and other directories that should be under version control. | |
# | |
# See the comments below for more info on how to add exceptions for your |
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 | |
// setup query | |
$args = array( | |
'post_type' => 'custom_post_type', | |
'post_status' => 'publish', | |
'orderby' => 'date', | |
'posts_per_page' => 10, | |
'no_found_rows' => true, | |
'update_post_meta_cache' => false, | |
'update_post_term_cache' => false, |
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 | |
/* | |
* Set Modern Tribe Event Tickets Plus custom SKU as: | |
* Title - StartDate | |
* @link https://smnr.co/2NqELpA | |
*/ | |
add_action( 'event_tickets_after_save_ticket', 'tribe_events_set_sku', 10, 4 ); | |
function tribe_events_set_sku( $event_id, $ticket, $raw_data, $classname ) { | |
if ( ! empty( $ticket ) && isset( $ticket->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 | |
/** | |
* Remove Woocommerce "The following addresses will be used on the checkout page by default." from My Account page | |
* @link https://smnr.co/woocommerce-remove-my-account-address-description | |
*/ | |
add_filter( 'woocommerce_my_account_my_address_description', '' ); |
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
<header> | |
<?php | |
$custom_logo = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' ); | |
?> | |
<img src="<?php echo $custom_logo[0]; ?>" alt="<?php bloginfo('name'); ?>" width="<?php echo $custom_logo[1]; ?>" height="<?php echo $custom_logo[2]; ?>"> | |
</header> |
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 my_theme_setup() { | |
/** | |
* Add support for core custom logo. | |
* | |
* @link https://codex.wordpress.org/Theme_Logo | |
*/ | |
add_theme_support( 'custom-logo', array( | |
'height' => 190, |
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
<header> | |
<?php | |
$custom_logo = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' ); | |
?> | |
<img src="<?php echo $custom_logo[0]; ?>" alt="<?php bloginfo('name'); ?>" width="128" height="19"> | |
</header> |
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
<header> | |
<svg class="site-logo" xmlns="http://www.w3.org/2000/svg" viewBox="..."> | |
<path fill="#1D1D1B" d="..."/> | |
<path fill="#1D1D1B" d="..."/> | |
</svg> | |
</header> |
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
<header> | |
<div class="site-logo"> | |
<svg xmlns="http://www.w3.org/2000/svg" viewBox="..."> | |
<path fill="#1D1D1B" d="..."/> | |
<path fill="#1D1D1B" d="..."/> | |
</svg> | |
</div> | |
</header> |
NewerOlder