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 | |
$args = array( | |
'post_type' => 'post', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'post_format', | |
'field' => 'slug', | |
'operator' => 'NOT IN' | |
'terms' => get_post_format_slugs(), | |
) |
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 | |
/* | |
Plugin Name: No-IP | |
Plugin URI: http://wordpress.org/support/topic/37363 | |
Description: Causes WordPress to NOT save the IP address from ANY commenter. WordPress will instead record all comment IP addresses as '127.0.0.1' | |
Author: WP-Forums | |
Author URI: http://wordpress.org/support/ | |
Version: 0.1 | |
*/ |
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 | |
/** | |
* Template Name: Movie Template | |
* Description: A Page Template for a movies pages. | |
*/ | |
function get_page_mediablock( $url ) { | |
global $wp_embed; | |
return $wp_embed->run_shortcode( '[embed width="1200"]' . esc_url_raw( $url ) . '[/embed]' ); | |
} |
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 | |
function get_my_video_embed( $post_id, $video_url ) { | |
global $wp_embed; | |
$key = '_my_video_' . md5( $video_url ); | |
$cache = get_post_meta( $post_id, $key, true ); | |
if ( ! empty( $cache ) ) | |
return $cache; | |
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
var $button = jQuery( '#my-button' ), | |
test = Math.floor((Math.random()*2)+1); | |
if ( test == 1 ) | |
$button.css( 'background', '#ff0000' ).data( 'test-value', 'red' ); | |
else | |
$button.css( 'background', '#0000ff' ).data( 'test-value', 'blue' ); | |
_gaq.push(['_trackEvent', 'My Button', 'Show', $button.data( 'test-value' )]); | |
$button.on( 'click', function() { |
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 | |
/** | |
* Plugin Name: Page Parent Link | |
*/ | |
function my_the_content( $content ) { | |
$post = get_post(); | |
if ( 'page' == $post->post_type && $post->post_parent > 0 ) { | |
$parent = new WP_Query( array( | |
'post_type' => 'page', | |
'post__in' => array( $post->post_parent ), |
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_action( 'init', 'my_init' ); | |
function my_init() { | |
register_post_type( 'book', array( | |
'public' => true, | |
'menu_icon' => 'dashicons-facebook', | |
) ); | |
} |
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 | |
function set_custom_dashicon() { | |
?> | |
<style type="text/css"> | |
#menu-posts-{post_type} .wp-menu-image:before { | |
content: '\f174'; | |
} | |
</style> | |
<?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
<?php | |
/** | |
* Plugin Name: Custom Excerpt Length | |
*/ | |
function custom_excerpt_length( $length ) { | |
return 10; | |
} | |
add_filter( 'excerpt_length', 'custom_excerpt_length' ); |
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(){ | |
var original_routes = wp.themes.routes; | |
wp.themes.routes = original_routes.extend({ | |
initialize: function() { | |
this.route( 'theme/:directory/:slug', 'wpcomtheme', function( directory, slug ) { | |
wp.themes.Run.view.view.expand( directory + '/' + slug ); | |
}); | |
return original_routes.prototype.initialize.apply( this, arguments ); | |
} |