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
| add_image_size( 'slider-image-large', 640, 280, true ); | |
| // Homepage Slider | |
| add_action('init', 'register_dmc_orbit_slider'); | |
| function register_dmc_orbit_slider() { | |
| $labels = array( |
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
| // thanks to Mike Little on WP-hackers | |
| add_filter( 'all_plugins', 'dmc_remove_some_plugins' ); | |
| function dmc_remove_some_plugins( $all ) { | |
| global $current_user; | |
| $remove_these = array( | |
| 'limit-login-attempts/limit-login-attempts.php', | |
| 'wordpress-firewall-2/wordpress-firewall-2.php', | |
| 'update-notifier/update-notifier.php', | |
| 'wp-super-cache/wp-cache.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
| // http://wordpress.stackexchange.com/a/75512/131 | |
| if (has_post_thumbnail()) | |
| //if the post already has a post thumbnail then just use that | |
| the_post_thumbnail($size = 'post-thumbnail', $attr = ''); | |
| else{ | |
| //if not then convert the custom field to the post thumbnail and display that | |
| $at_url = get_post_meta($post->ID, 'image', true); | |
| $at_id = get_image_id_by_url($at_url); | |
| delete_post_meta($post->ID, 'image'); |
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 # -*- coding: utf-8 -*- | |
| /** | |
| * Plugin Name: T5 Parent Terms in body_class | |
| * Description: Adds all parent terms of a term archive to <code>body_class()</code>. | |
| * Version: 2012.0.14 | |
| * Author: Thomas Scholz <[email protected]> | |
| * Author URI: http://toscho.de | |
| * License: MIT | |
| * License URI: http://www.opensource.org/licenses/mit-license.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
| // check if category is a parent | |
| function dmc_is_parentcat() { | |
| $cat = get_query_var('cat'); | |
| $category = get_category($cat); | |
| $category->parent; | |
| return ( $category->parent == '0' ) ? true : false; | |
| } |
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 | |
| /*-----------------------------------------------------------------------------------*/ | |
| /* Conditional Logic to Detect Various Event Related Views/Pages | |
| /*-----------------------------------------------------------------------------------*/ | |
| if( tribe_is_month() && !is_tax() ) { // Month View Page | |
| echo 'were on the month view page'; | |
| } elseif( tribe_is_month() && is_tax() ) { // Month View Category Page |
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 get_header(); ?> | |
| <!-- About --> | |
| <div id="content" class="eight columns"> | |
| <div class="post-box"> | |
| <?php while ( have_posts() ) : the_post(); ?> |
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 | |
| $parents = get_post_ancestors( $post->ID ); | |
| $id = ($parents) ? $parents[count($parents)-1]: $post->ID; | |
| $title = ($parents) ? $parents[count($parents)-1]: $post->title; | |
| ?> | |
| <?php if( get_field( 'dmc_hero_image', $id ) ) : ?> | |
| <div class="row"> | |
| <div class="twelve columns page-title"> | |
| <img src="<?php the_field('dmc_hero_image', $id); ?>" width="990" class="hide-for-small" /> |
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
| add_action('save_post', 'wpds_check_thumbnail'); | |
| add_action('admin_notices', 'wpds_thumbnail_error'); | |
| function wpds_check_thumbnail($post_id) { | |
| // change to any custom post type | |
| if(get_post_type($post_id) != 'post') | |
| return; | |
| if ( !has_post_thumbnail( $post_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
| <?php | |
| /** | |
| * Change text strings | |
| * | |
| * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
| */ | |
| function my_text_strings( $translated_text, $text, $domain ) { | |
| switch ( $translated_text ) { | |
| case 'Related Products' : | |
| $translated_text = __( 'Check out these related products', 'woocommerce' ); |