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( | |
'cat' => 4, | |
'posts_per_page' => 4, | |
'post__in' => get_option( 'sticky_posts' ), | |
); | |
$showNewsSticky = new WP_Query( $args ); | |
while ($showNewsSticky->have_posts()) : $showNewsSticky->the_post(); ?> | |
<h2 class="small2 marginBottomQuater"> | |
<a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a> | |
</h2> |
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
if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page | |
} elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages | |
} elseif( tribe_is_event() && !tribe_is_day() && !is_single() ) { // The Main Events List | |
} elseif( tribe_is_event() && is_single() ) { // Single Events | |
} elseif( tribe_is_day() ) { // Single Event Days | |
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
// Remove unwanted dashboard items | |
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets'); | |
function my_custom_dashboard_widgets() { | |
global $wp_meta_boxes; | |
//QuickPress | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); | |
//Wordpress Development Blog Feed | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); |
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 elseif ( has_post_thumbnail() ) : | |
$featured_image_link = ( get_field( 'featured_image_links_to' ) ); | |
if ( $featured_image_link ) { | |
echo '<a href="'.get_permalink($post_object->ID) .'">'; | |
if ( has_post_thumbnail()) { the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) ); } | |
echo '</a>'; | |
} else { | |
the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) ); | |
}; | |
endif; ?> |
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 get_deep_child_category( $categories ) | |
{ | |
$categories = get_the_category(); | |
$maxId = 0; | |
$maxKey = 0; | |
foreach ( $categories as $key => $value ) | |
{ | |
if ( $value->parent > $maxId ) | |
{ | |
$maxId = $value->term_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
// Remove obsolete user contact info and add new | |
function dmc_new_contactmethods( $contactmethods ) { | |
// Remove these | |
unset($contactmethods['aim']); | |
unset($contactmethods['yim']); | |
unset($contactmethods['jabber']); | |
// Add Twitter | |
$contactmethods['twitter'] = 'Twitter'; |
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 reverie_entry_meta() { | |
$num_comments = get_comments_number(); | |
$tags=get_the_tag_list(' ', ', '); | |
$output =''; | |
$output .= '<div class="entry-meta"><p>'; | |
$output .= '<time class="updated" datetime="'. get_the_time('c') .'" pubdate>'. sprintf(__('%s'), get_the_time('jS F Y')) .'</time>, '; | |
// $output .= comments_number( 'No comments yet', '1 comment', '% comments' ); | |
if ( comments_open() ) { |
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 the_widget('TribeEventsAdvancedListWidget', 'title=Upcoming Events', | |
(array( | |
'before_widget' => '<article id="%1$s" class="widget %2$s"><div class="sidebar-section">', | |
'after_widget' => '</div></article>', | |
'before_title' => '<h5>', | |
'after_title' => '</h5>' | |
)) | |
); ?> |
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 filter_visible_plugins($plugins) { | |
//Plugin file paths relative to /wp-content/plugins/ | |
$pluginsToHide = array( | |
'akismet/akismet.php', | |
'hidden-plugin/hidden-plugin.php', | |
'another-plugin/filename.php', | |
); | |
//As an example, lets hide the above plugins from everyone | |
//except user 'smith'. Replace this with your own security checks. |
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 myFunction(){ | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
//get the names from column B | |
var n = sheet.getRange('B:B').getValues(); | |
var f = []; | |
for(var i=0; i<n.length; i++){ | |
//Reformat each name and push it in array f | |
f.push(reformat(n[i][0])); | |
} | |
//Write back the reformatted name in Column C & D |