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
add_action( 'pre_get_posts', function( $query ) { | |
if ( ! is_admin() && $query->is_main_query() && $query->is_search() ) { | |
$excluded_pages = array( 'PAGE_1_ID', 'PAGE_2_ID' ); | |
set_query_var( 'post__not_in', $excluded_pages ); | |
} | |
} ); |
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
add_filter( 'wpex_{YOUR_POST_TYPE_NAME}_entry_media_lightbox', '__return_true' ); |
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
add_filter( 'wpex_cpt_entry_supported_media', function( $media_types ) { | |
$media_types[] = 'gallery'; | |
return $media_types; | |
} ); |
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
add_filter( 'body_class', function( $class ) { | |
if ( function_exists( 'is_shop' ) && is_shop() ) { | |
$class[] = 'shop-page'; | |
} | |
return $class; | |
} ); |
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
/** | |
* Returns correct theme button classes based on args. | |
* | |
* @since 3.2.0 | |
*/ | |
function wpex_get_button_classes( $style = array(), $color = '', $size = '', $align = '' ) { | |
$args = $style; | |
if ( ! is_array( $args ) ) { |
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
add_action( 'wpex_hook_content_top', function() { | |
echo '<div class="entry wpex-mb-25" style="font-size:16px;">'; | |
wpex_card( 'list-1', array( | |
'title' => 'This is a custom title', | |
'excerpt' => 'This is a custom excerpt', | |
'image' => 'http://localhost/total/wp-content/uploads/sites/5/2019/05/us-air-force-77909-150x150.jpg', | |
) ); |
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
add_action( 'wpex_hook_site_logo_inner', function() { ?> | |
<a href="PAGE LINK" class="my-second-logo"><img src="URL of the image" /></a> | |
<?php }, 40 ); |
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
// Open custom links in a new tab | |
add_action( 'wp_footer', function() { ?> | |
<script> | |
jQuery( '.entry.has-redirect' ).each( function() { | |
var $this = jQuery( this ); | |
$this.find( '.entry-title a, .entry-media a, .entry-readmore-wrap a' ).attr( { | |
'target' : '_blank', | |
'rel' : 'noopener noreferrer' | |
} ); |
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
add_filter( 'wpex_localize_array', function( $array ) { | |
$array['altercf7Prealoader'] = false; | |
return $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
$string = WPSEO_Meta::get_value( 'title', $post_id ); | |
if ( ! empty( $string ) { | |
$replacer = new WPSEO_Replace_Vars(); | |
return $replacer->replace( $string, get_post($post_id) ); | |
} |