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 | |
$i = 0; | |
$max_iterations = 300; | |
$string_to_copy = 'your string'; | |
while ($i =< $max_iterations) { | |
echo $string_to_copy; | |
echo '<br><br>'; // just to have some space between each iteration | |
$i++; | |
} |
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 | |
/** | |
* Filter the iCal link generated by The Events Calendar Pro to use the webcal | |
* protocal instead of http | |
* | |
* Note: if you have https:// on your site, pelase adjust accordingly | |
* | |
* @author jkudish | |
* @param string $link the original | |
* @return string $link the filtered link |
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 | |
/** | |
* This is an example of a query which gets a single random event from the | |
* 'featured' event category amongsts evetns from The Events Calendar | |
* | |
* @see http://tri.be/support/forums/topic/random-featured-event-custom-widget/ | |
*/ | |
get_header(); |
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 /* Template Name: Home */ ?> | |
<?php get_header(); ?> | |
<?php // echo adrotate_group(1); ?> | |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<div class="left"> | |
<?php the_content() ?> | |
</div> | |
<div class="main-image"><?php the_post_thumbnail( 'full' ); ?></div> |
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 wp_dropdown_categories( array('taxonomy' => TribeEvents::TAXONOMY) ); ?> |
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 | |
add_action('wp_enqueue_scripts', 'tribe_remove_javascript'); | |
function tribe_remove_javascript() { | |
wp_dequeue_script('sp-events-pjax'); | |
wp_dequeue_script('sp-events-calendar-script'); | |
} |
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 | |
add_filter('pre_get_posts', 'tribe_filter_days_on_single_day', 20); | |
function tribe_filter_days_on_single_day($query) { | |
if (tribe_is_day()) { | |
$query->set('nopaging', true); | |
} | |
return $query; | |
} |
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 | |
$role = get_role( 'administrator' ); | |
$role->add_cap( 'edit_tribe_event' ); | |
$role->add_cap( 'read_tribe_event' ); | |
$role->add_cap( 'delete_tribe_event' ); | |
$role->add_cap( 'edit_tribe_events' ); | |
$role->add_cap( 'edit_others_tribe_events' ); | |
$role->add_cap( 'publish_tribe_events' ); | |
$role->add_cap( 'read_private_tribe_events' ); |
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 | |
add_action('wp_head','tribe_dont_index_single_events'); | |
function tribe_dont_index_single_events() { | |
if ( is_singular() && get_post_type() == TribeEvents::POSTTYPE ) | |
echo '<meta name="robots" content="noindex">'; | |
} |
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 | |
/** | |
* this is lines 563-573 of /lib/tribe-view-helpers.class.php | |
*/ | |
private static function years( ) { | |
$year = ( int )date_i18n( 'Y' ); | |
// Back two years, forward 5 | |
$year_list = array( $year - 1, $year, $year + 1, $year + 2, $year + 3, $year + 4, $year + 5 ); |