cmplz-show-banner

/** * Show the banner when a html element with class ‘cmplz-show-banner’ is clicked */ function cmplz_show_banner_on_click() { ?>Continue reading

(cloud) r2c on Call Param

//script: r2c on Call Param with Enhanced Tracking //ver 2.6 if (!defined(‘ABSPATH’)) exit; // Static phone number override – if set, will bypass all other functionality $static_phone_number = ‘8001234567’; // Set your phone number here, e.g. ‘8001234567’ // If static…Continue reading

Add Another Meta Keyword to Each Post

add_filter( ‘aioseo_keywords’, ‘aioseo_filter_keywords’ ); function aioseo_filter_keywords( $keywords ) { if ( is_singular() ) { $keywords = explode( ‘,’, $keywords ); array_push( $keywords, ‘anotherkeyword’ ); $keywords = implode( ‘,’, $keywords ); } return $keywords ; }Continue reading

change search url

function wpb_change_search_url() { if ( is_search() && ! empty( $_GET[‘s’] ) ) { wp_redirect( home_url( “/search/” ) . urlencode( get_query_var( ‘s’ ) ) ); exit(); } } add_action( ‘template_redirect’, ‘wpb_change_search_url’ );Continue reading

Preload First Post Image

function preload_first_content_image() { if (is_single()) { $post = get_post(); if ($post) { // Get post content $content = $post->post_content; // Find first image in the content preg_match_all(‘//i’, $content, $matches); if (!empty($matches[1])) { $first_image = $matches[1][0]; echo ‘‘; } } }…Continue reading

Inputs & Buttons

function get_city_field( $user_id = null, $role = null, $required = null, $readonly = null) { $field[‘name’] = ‘_city’; $field[‘label’] = ‘City’; $field[‘key’] = ‘city’; // // if( $user_id && in_array(‘exhibitor’, get_userdata( $user_id )->roles )){ // $field[‘label’] = ‘Gallery City’; //…Continue reading