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
if (!wp_next_scheduled('my_task_hook')) { | |
wp_schedule_event( time(), 'hourly', 'my_task_hook' ); | |
} | |
add_action( 'my_task_hook', 'my_task_function' ); | |
function my_task_function() { | |
wp_mail('[email protected]', 'Automatic email', 'Hello, this is an automatically scheduled email from WordPress.'); | |
} |
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
order allow,deny | |
deny from 64.64.2.102 | |
allow from all |
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 // add the admin options page | |
add_action('admin_menu', 'plugin_admin_add_page'); | |
function plugin_admin_add_page() { | |
add_options_page('Custom Plugin Page', 'Custom Plugin Menu', 'manage_options', 'plugin', 'plugin_options_page'); | |
} | |
?> | |
<?php // display the admin options page | |
function plugin_options_page() { | |
?> | |
<div> |
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
<!DOCTYPE HTML> | |
<!-- attribution -- this blog provided the code | |
http://blog.makingsense.com/2011/03/create-stand-alone-web-pages-or-widgets-that-use-wordpress-functions/ | |
--> | |
<?php | |
//required include files | |
require('wp-blog-header.php'); | |
require_once("wp-config.php"); | |
require_once("wp-includes/wp-db.php"); |
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
function get_category_tags($args) { | |
global $wpdb; | |
$tags = $wpdb->get_results | |
(" | |
SELECT DISTINCT terms2.term_id as tag_id, terms2.name as tag_name, null as tag_link | |
FROM | |
wp_posts as p1 | |
LEFT JOIN wp_term_relationships as r1 ON p1.ID = r1.object_ID | |
LEFT JOIN wp_term_taxonomy as t1 ON r1.term_taxonomy_id = t1.term_taxonomy_id | |
LEFT JOIN wp_terms as terms1 ON t1.term_id = terms1.term_id, |
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
/* Finite scroll functions */ | |
jQuery('.nextpage').click(function(){ | |
var nextpageno=$('.nextpageno:last').html(); /* write this element with php into div, kind of hinky */ | |
if (nextpageno>0) { | |
$('.inside').append($(document.createElement("div")).load('<?php echo $nextpagelink."/"?>' + nextpageno + ' .inside-left') ); | |
} | |
}); | |
jQuery(document).ajaxSend(function(event, request, settings) { | |
$('.nextpage').css("display","none"); |
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
// FILTER: GLOBAL PHP | |
// SETUP CODE | |
global $randvalforslides; | |
$randvalforslides=rand(1,2); | |
// FILTER CODE --------------------------------------------- | |
$node = node_load($row->nid); | |
$fhg = $node->field_homepage_group; | |
$fhg1=$fhg['und'][0]['value']; | |
global $randvalforslides; |
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
$random_post = new WP_query(); | |
$random_post->query('cat=3&showposts=1&orderby=rand'); | |
while ($random_post->have_posts()) : $random_post->the_post(); | |
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"> | |
<img src="<?php echo get_post_meta($random_post->ID, 'featured', true); ?>"> | |
</a> | |
endwhile; | |
wp_reset_postdata(); |
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
<!-- start floatingbuttons --> | |
<script src='http://apis.google.com/js/plusone.js' type='text/javascript'> {lang: 'en-US'} </script> | |
<div id='floatingbuttons' title="Share this post!"><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><script type="text/javascript"> (function() { var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0]; s.type = 'text/javascript'; s.async = true; s.src = 'http://widgets.digg.com/buttons.js'; s1.parentNode.insertBefore(s, s1); })(); </script><!-- Medium Button --><script src='http://platform.twitter.com/widgets.js' type="text/javascript"></script> | |
<div class='floatbutton' id='facebook'><fb:like layout="box_count" show_faces="false" font=""></fb:like></div> | |
<div class='floatbutton' id='google+1'><g:plusone size="tall"></g:plusone></div> | |
<div class='floatbutton' id='stumbleupon'><script src="http://www.stumbleupon.com/hostedbadge.php?s=5"></script></div> | |
<div class='floatbutton' id='digg'><a class="DiggThisButton DiggM |
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
/* SERIOUSLY? */ | |
add_action( 'genesis_meta', 'sample_viewport_meta_tag' ); | |
function sample_viewport_meta_tag() { | |
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>'; | |
} | |
add_theme_support( 'html5' ); |
OlderNewer