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
( function($){ | |
var parent_ul_selector = '#menu-header-navigation', /* Selector for the nav menu you're working with. */ | |
child_li_selector = '.nav-mid-item', /* Selector for child <li> elements this applies to. */ | |
new_div_id_prefix = 'menu-replace', /* ID prefix for the newly created <div> elements. */ | |
new_div_class = 'menu-replaced', /* Class for the newly created <div> elements. */ | |
column_selector_prefix = 'column', /* Selector prefix used for newly created <ul> elements. */ | |
new_ul_class = 'sub-menu-replace', /* Class for newly created <ul> elements. */ | |
max_columns = 3, /* Maximum columns, pending available list items */ | |
min_column_size = 2, /* Minimum items in the shortest column before # of columns is reduced. */ | |
div_count = 0, /* For C |
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 | |
/* Register our IE specific stylesheets. */ | |
wp_register_style( 'prefix-ie7-only', get_template_directory_uri() . '/css/ie7.css' ); | |
wp_register_style( 'prefix-ie8-only', get_template_directory_uri() . '/css/ie8.css' ); | |
wp_register_style( 'prefix-ie9-only', get_template_directory_uri() . '/css/ie.css' ); | |
/* Use the global wp_styles object to add our conditional statements due to the lack | |
* of conditional support in wp_register_style | |
*/ |
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_filter( 'get_bookmarks', 'prefix_resize_blogroll_images' ); | |
function prefix_resize_blogroll_images( $output ) { | |
for ( $i = 0, $total = sizeof( $output ); $i < $total; $i++ ) { | |
if ( 'http' == substr( $output[ $i ]->link_image, 0, 4 ) ) | |
$output[ $i ]->link_image = wpcom_vip_get_resized_remote_image_url( $output[ $i ]->link_image, 72, 51, false ); | |
else | |
$output[ $i ]->link_image = ''; | |
} |
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 | |
/** | |
* Set API URLS | |
*/ | |
function accessTokenURL() { return 'https://api.twitter.com/oauth/access_token'; } | |
function authenticateURL() { return 'https://api.twitter.com/oauth/authenticate'; } | |
function authorizeURL() { return 'https://api.twitter.com/oauth/authorize'; } | |
function requestTokenURL() { return 'https://api.twitter.com/oauth/request_token'; } |
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 | |
/* Used to display the excerpt of a post across the site. Written very closely with | |
* wp_trim_excerpt, but instead of stripping out all tags, we want to make sure that | |
* some basic style still remains as this display function will be used for the index | |
* and archive templates, not something as plain as a feed or meta description. */ | |
function prefix_display_excerpt( $number_of_words = 55 ) { | |
global $post; | |
$content = get_the_content(); | |
$content = strip_shortcodes( $content ); | |
$content = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $content ); |
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 | |
/* Modify the output of list items in the header navigation menu. | |
* | |
* Remove the whitespace between HTML tags. Required specifically for better | |
* behavior when list items are inline-block in our main nav menu and need | |
* the browsers to adhere to exact margins. | |
* | |
* NOTE: filter name changes depending on your menu - this one works for 'navigation_items' | |
*/ |
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 | |
$default_html = '<script type="text/javascript">document.write(\'<scr\' + \'ipt type="text/javascript">ad_urls["%ad_frame_id%"] = "%url%";</scr\' + \'ipt>\');</script>'; |
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 brief overview of filters that are now available in Automatic Featured Image Posts. | |
* | |
* These allow easy overriding of the default post title, categories, and content before | |
* the new post is created, while still maintaining the core priority of the plugin, | |
* which is to add a new post with a featured image assigned to it */ | |
add_filter( 'afip_new_post_title', 'myprefix_change_afip_post_title', 10, 2 ); | |
/* Adds 'Magic Photo: ' to the front of every auto generated post tile from | |
* Automatic Featured Image Posts */ | |
function myprefix_change_afip_post_title( $post_title, $attachment_id ) { |
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 | |
/* | |
* Creates a custom post type with the key 'prefix_post_type', with a basic | |
* configuration that provides for public access on the front end and admin. | |
* | |
*/ | |
add_action( 'init', 'prefix_register_post_type' ); | |
function prefix_register_post_types() { | |
$public_pt_args = array( | |
'label' => 'My Post Type', |
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 | |
/* If public is not specified when registering a custom post type, false | |
* is used by default. */ | |
$non_public_pt_args = array( 'public' => false ); | |
/* The above is the same as specifying the following. */ | |
$non_public_pt_args = array( | |
'public' => false, | |
'publicly_queryable' => false, | |
'exclude_from_search' => true, |
OlderNewer