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
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
function child_manage_woocommerce_styles() { | |
//remove generator meta tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
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 | |
/** | |
* Get youtube video ID from URL | |
* | |
* @param string $url the video url. | |
* @return string Youtube video id or FALSE if none found. | |
*/ | |
function youtube_id_from_url( $url ) { | |
$pattern = | |
'%^# Match any youtube URL |
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 | |
/** | |
* Redirect user after successful login. | |
* | |
* @param string $redirect_to URL to redirect to. | |
* @param string $request URL the user is coming from. | |
* @param object $user Logged user's data. | |
* @return string | |
*/ |
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 if ( $phone = get_field( 'phone' ) ) : ?> | |
<?php echo esc_html( $phone ); ?> | |
<?php endif; ?> | |
<?php if ( $email = get_field( 'email' ) ) : ?> | |
<a href="mailto:<?php echo $email; ?>"><?php echo $email; ?></a> | |
<?php endif; ?> | |
<?php echo esc_url( get_field( 'website' ) ); ?> | |
<?php |
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 if ( $phone = get_field('phone') ): ?> | |
<?php echo esc_html($phone); ?> | |
<?php endif; ?> | |
<?php if ( $email = get_field('email') ): ?> | |
<a href="mailto:<?php echo $email; ?>"><?php echo $email; ?></a> | |
<?php endif; ?> | |
<?php echo esc_url(get_field('website')); ?> | |
<?php |
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 | |
// Get previous post. | |
$previous_post = get_previous_post( true ); | |
if ( ! empty( $previous_post ) ) { | |
$prev_thumbnail = get_the_post_thumbnail( $previous_post->ID, 'thumbnail' ); | |
} else { | |
$prev_thumbnail = ''; | |
} | |
// Get next post. | |
$next_post = get_next_post( 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
<nav class="navigation post-navigation" role="navigation" aria-label="Posts"> | |
<h2 class="screen-reader-text">Post Navigation</h2> | |
<div class="nav-links"> | |
<?php | |
global $wpdb; | |
$results = $wpdb->get_results( | |
$wpdb->prepare( | |
" | |
SELECT * | |
FROM $wpdb->posts |
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 | |
/** | |
* Block Name: Featured Videos | |
* | |
* This is the template that displays Featured Videos block. | |
* | |
* @package Meta13_Functionality | |
* @since 1.4.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
<?php | |
/** | |
* Set sizes attribute for responsive images and better performance | |
* | |
* @param array $attr markup attributes. | |
* @param object $attachment WP_Post image attachment post. | |
* @param string|array $size named image size or array. | |
* @return array markup attributes | |
*/ |
NewerOlder