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
/* | |
Drop cap first letter of each post. | |
*/ | |
function add_drop_caps($content) | |
{ | |
global $post; | |
//only posts | |
if(!empty($post) && $post->post_type == "post") | |
{ |
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 | |
/** | |
* A class to create simple custom routes. | |
* | |
* Example usage: | |
* | |
* $theme_routes = new CustomRoutes(); | |
* $theme_routes->addRoute( | |
* |
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 | |
/** | |
* @package Custom_queries | |
* @version 1.0 | |
*/ | |
/* | |
Plugin Name: Custom queries | |
Plugin URI: http://wordpress.org/extend/plugins/# | |
Description: This is an example plugin | |
Author: Carlo Daniele |
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 | |
/** | |
* Programmatically install and activate wordpress plugins | |
* | |
* Usage: | |
* 1. Edit the $pluginSlugs array at the beginning of this file to include the slugs of all the | |
* plugins you want to install and activate | |
* 2. Upload this file to the wordpress root directory (the same directory that contains the | |
* 'wp-admin' directory). | |
* 3. Navigate to <your-domain-wordpress-root>/install-wp-plugins.php (If wordpress is installed |
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 | |
function get_random_post_link() { | |
$args = array( | |
'orderby' => 'rand', | |
'posts_per_page' => '1', | |
); | |
$wp_query = new WP_Query( $args ); | |
if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post(); |