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 | |
/** | |
* Adding an ad after the second paragraph | |
* | |
*/ | |
add_filter( 'the_content', 'tb_insert_post_ads' ); | |
function tb_insert_post_ads( $content ) { | |
$ad_code = 'The ad code goes here. Both static ads and Google Adsense.'; |
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 | |
// Copy from here | |
//Deleting WordPress authentification | |
remove_filter('authenticate', 'wp_authenticate_username_password', 20); | |
// Placing new authentification - sign up via email and password only | |
add_filter('authenticate', function($user, $email, $password){ | |
//Check for empty fields |
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 | |
/** | |
* A new logo for the admin area and an own background color | |
* @author Andreas Hecht | |
*/ | |
function ah_login_logo() { | |
?> | |
<style type="text/css"> | |
#login h1 a, .login h1 a { |
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 | |
while (have_posts()) : the_post(); | |
$taxonomy = 'your_taxonomy'; // change this to your taxonomy | |
//$terms = wp_get_post_terms( $post->ID, $taxonomy, array( "fields" => "ids" ) ); | |
$terms = wp_get_post_terms( $post->ID, $taxonomy, array( "fields" => "slugs" ) ); | |
if( $terms ) $all_terms = array_merge($all_terms, $terms); | |
endwhile; | |
if ($all_terms) : |
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
// Needed this for a client project, thanks! I improved upon it to make it more generic so you don't have to look up individual IDs on elements: | |
jQuery(document).ready(function(){ | |
// Check all in Gravity Forms | |
jQuery('.checkall li:first-child input').click(function() { | |
jQuery(this).parent('li').parent('ul').find(':checkbox').attr('checked', this.checked); | |
}); | |
}); | |
// Just add a class "checkall" to your checkbox form item in Gravity Forms, it assumes the first item in the list will be the "All" option. |
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 // custom functions.php template @ digwp.com | |
// add feed links to header | |
if (function_exists('automatic_feed_links')) { | |
automatic_feed_links(); | |
} else { | |
return; | |
} | |
NewerOlder