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 | |
/*-----------------------------------------------------------------------------------*/ | |
/* 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 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 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 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 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' ); |
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 get_me_the_email_feed_template() { | |
add_filter('the_content_feed', 'css_tricks_super_awesome_feed_image_magic'); | |
include(ABSPATH . '/wp-includes/feed-rss2.php' ); | |
} | |
function css_tricks_super_awesome_feed_image_magic($content) { | |
// Weirdness we need to add to strip the doctype with later. | |
$content = '<div>' . $content . '</div>'; | |
$doc = new DOMDocument('1.0', 'utf-8'); | |
$doc->LoadHTML('<?xml encoding="UTF-8">' . $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 | |
$terms = get_terms( 'sponsor_type', array( | |
'orderby' => 'id', | |
) ); | |
?> | |
<?php | |
foreach( $terms as $term ) { | |
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
add_action( 'widgets_init', 'dmc_register_sidebars' ); | |
function dmc_register_sidebars() { | |
register_sidebar(array( | |
'name'=> 'Conferences Sidebar', | |
'id' => 'sidebar-conferences', | |
'description' => 'Widgets placed here will appear in the sidebar on the Conferences pages', | |
'before_widget' => '<article id="%1$s" class="panel widget %2$s">', | |
'after_widget' => '</article>', | |
'before_title' => '<h4>', |
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
if ( ! current_user_can( 'manage_options' ) ) { | |
add_action( 'admin_menu', 'admin_menu_example' ); | |
} | |
function admin_menu_example() { | |
remove_menu_page( 'index.php' ); //Dashboard | |
remove_menu_page( 'edit.php' ); //Posts | |
remove_menu_page( 'upload.php' ); //Media | |
remove_menu_page( 'edit.php?post_type=page' ); //Pages | |
remove_menu_page( 'edit-comments.php' ); //Comments |
OlderNewer