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 | |
add_action( 'pre_get_posts', 'fpl_maybe_alter_main_query' ); | |
function fpl_maybe_alter_main_query( $query ) { | |
//only perform this action on the main query on the frontend | |
if ( $query->is_main_query() && ( ! is_admin() ) ) { | |
//only do this for logged in users | |
if ( is_user_logged_in() ) { |
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
add_filter( 'the_content', 'cv_the_content_filter' ); | |
function cv_the_content_filter( $content ) { | |
$can_user_watch_videos = cv_can_user_watch_videos(); | |
if ( $can_user_watch_videos !== true ) { | |
$content = $can_user_watch_videos; | |
} |
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 | |
//Add this code below to your functions.php, replace 'name-of-tag' and 'value-of-tag' | |
add_action( 'wp_head', 'my_meta_tags' ); | |
function my_meta_tags() { | |
?> | |
<meta name="name-of-tag" content="value-of-tag"> | |
<?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
add_action( 'wp_head', 'fpl_add_stuff_to_head' ); | |
function fpl_add_stuff_to_head() { | |
?> | |
<!-- BEGIN add your <head> html below --> | |
<!-- END add your <head> html below --> | |
<?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
add_filter( 'gform_validation_message', 'dd_gform_validation_message' , 10, 2 ); | |
function dd_gform_validation_message( $message, $form ) { | |
return "<div class='validation_error'>" . __( 'There was a problem with your submission.', CHILD_THEME_TEXTDOMAIN ) . ' ' . __( 'Errors have been highlighted below.', CHILD_THEME_TEXTDOMAIN ) . '</div>'; | |
} |
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
add_shortcode( 'tag-relations', 'posts_relations_by_tags' ); | |
/** | |
*Renders all post relations defined by tags-relation | |
* | |
* @author Floris P. Lof | |
*/ | |
function posts_relations_by_tags() { | |
$found_posts = false; | |
$found_posts_ids = array(); |
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
add_filter( 'embed_oembed_html', 'oembed_transparency', 10, 4 ); | |
/** | |
* oEmbed Transparency. | |
* | |
* Used so that menus can appear on top of videos. | |
* | |
* @since 1.0.0 | |
* | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/code/oembed-transparency |
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
add_filter( 'genesis_favicon_url', 'customize_favicon_url' ); | |
/** | |
* Change location of favicon reference. | |
* | |
* @since 1.0.0 | |
* | |
* @global int $blog_id Current blog ID. | |
* | |
* @return string Updated favicon 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
add_filter( 'wp_headers', 'add_ie_compatibility_header' ); | |
/** | |
* Disable IE compatibilty view modus. | |
* | |
* Not 100% guaranteed to have affect. | |
* | |
* @since 1.0.0 | |
*/ | |
function add_ie_compatibility_header( $headers ) { |
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
add_action( 'wp_head', 'append_header_js_vars' ); | |
/** | |
* Append some handy dandy JS vars to the head | |
* | |
* Adds necessary code to start the PE-application (on document ready), | |
* with the WP_DEBUG boolean as a parameter. | |
* | |
* @since 1.0.0 | |
*/ | |
function append_header_js_vars() { |
NewerOlder