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 | |
/* | |
Plugin Name: FixWpCaption | |
Plugin URI: # | |
Description: Removes inline CSS from .wp-caption | |
*/ | |
class FixWpCaption{ | |
public function __construct(){ | |
add_filter('img_caption_shortcode', array($this, 'fixcaption'), 10, 3); |
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
<ul class="feed events"> | |
<?php | |
global $post; | |
$args = array( | |
'numberposts' => 3, | |
'category' => 3, | |
'meta_key' => 'event_date', | |
'meta_value' => date("Y-m-d"), | |
'meta_compare' => '>=', | |
'orderby' => 'meta_value', |
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 PDF filter to media library | |
add_filter( 'post_mime_types', 'modify_post_mime_types' ); | |
function modify_post_mime_types( $post_mime_types ) { | |
// select the mime type, here: 'application/pdf' | |
// then we define an array with the label values | |
$post_mime_types['application/pdf'] = array( __( 'PDFs' ), __( 'Manage PDFs' ), _n_noop( 'PDF <span class="count">(%s)</span>', 'PDFs <span class="count">(%s)</span>' ) ); | |
// then we return the $post_mime_types variable | |
return $post_mime_types; |
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_action( 'init', 'unregister_taxonomy'); | |
function unregister_taxonomy(){ | |
global $wp_taxonomies; | |
$taxonomy = 'post_tag'; | |
if ( taxonomy_exists( $taxonomy)) | |
unset( $wp_taxonomies[$taxonomy]); | |
} |
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 | |
// Anchor when erroring | |
add_filter("gform_confirmation_anchor", create_function("","return true;")); | |
// Error message | |
add_filter("gform_validation_message", "change_message", 10, 2); | |
function change_message($message, $form){ | |
//return "Failed Validation - " . $form["title"]; | |
return "<strong class=\"message error\">Please complete the required fields and try again</strong>"; |
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
<? | |
// Remove columns from Tags section and add Tag ID | |
// ------------------------------------------------------------- | |
add_filter('manage_edit-post_tag_columns', 'my_post_tag_columns', 5); | |
function my_post_tag_columns($defaults) { | |
$defaults['tag_id'] = 'Tag ID'; | |
unset($defaults['description']); | |
unset($defaults['slug']); | |
return $defaults; |
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
<? | |
// no idea why this works but add to wp-config.php | |
define('SCRIPT_DEBUG', true); |
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
/*----------------------------------------------------------------------------------------*/ | |
/* Opt-in typography - http://goo.gl/H6sGd | |
* Zero off common semantic elements to stop re-definition | |
* Use .text class on the parent of anything requiring text styles | |
/*----------------------------------------------------------------------------------------*/ | |
$baseline: 1.5em; | |
@mixin zero-text-elements { | |
h1, h2, h3, h4, h5, h6, blockquote, pre, |
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 | |
// gets the ID from a custom field to show posts on a specific page | |
$buildType = get_post_meta($post->ID, 'build_type_id', true); | |
// run query | |
query_posts(array( | |
'post_type' => 'portfolio', | |
'showposts' => -1, | |
'tax_query' => array( | |
array( |
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 | |
$morestring = '<!--more-->'; | |
$explode_content = explode( $morestring, $post->post_content ); | |
$content_before = apply_filters( 'the_content', $explode_content[0] ); | |
$content_after = apply_filters( 'the_content', $explode_content[1] ); | |
?> |
NewerOlder