This file contains hidden or 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
$out = ""; | |
$out .= "<table>"; | |
foreach($arrayname as $key => $element){ | |
$out .= "<tr>"; | |
foreach($element as $subkey => $subelement){ | |
$out .= "<td>$subelement</td>"; | |
} | |
$out .= "</tr>"; | |
} | |
$out .= "</table>"; |
This file contains hidden or 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
// **************************************************************************************************** | |
// AMP support | |
define( 'AMP_QUERY_VAR', apply_filters( 'amp_query_var', 'amp' ) ); | |
add_rewrite_endpoint( AMP_QUERY_VAR, EP_PERMALINK ); | |
add_filter( 'template_include', 'amp_page_template', 99 ); | |
function amp_page_template( $template ) { |
This file contains hidden or 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
// **************************************************************************************************** | |
// Video Sitemap | |
add_action( "save_post", "eg_create_sitemap" ); | |
function eg_create_sitemap() { | |
// youtube_video is the ACF video where I store the normal YouTube link | |
$args = array( |
This file contains hidden or 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
jQuery( window ).load(function() { | |
// This jQuery event only triggers after the first time a user scrolls. Your map loads once they scroll. This only makes sense if the map is below the fold | |
jQuery( window ).one( "scroll", function() { | |
loadAPI(); | |
}); |
This file contains hidden or 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
UPDATE `table_name` SET `field_value` = SUBSTRING_INDEX(field_value, /', -1) WHERE `col_value` = 'col_match' |
This file contains hidden or 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 height and width automatic from image captions | |
add_shortcode('wp_caption', 'fixed_img_caption_shortcode'); | |
add_shortcode('caption', 'fixed_img_caption_shortcode'); | |
function fixed_img_caption_shortcode($attr, $content = null) { | |
if ( ! isset( $attr['caption'] ) ) { | |
if ( preg_match( '#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is', $content, $matches ) ) { |