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
<? | |
/** | |
* Truncates text. | |
* | |
* Cuts a string to the length of $length and replaces the last characters | |
* with the ending if the text is longer than length. | |
* | |
* See: oikos.org.uk/2013/02/tech-notes-a-wordpress-excerpt-with-html-tags/ | |
* See also: wpengineer.com/2410/dont-use-strlen/ | |
* See also also: oikos.org.uk/2013/02/tech-notes-a-wordpress-excerpt-with-html-tags/#comment-1467093876 |
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
See: https://gist.github.com/56edda993e0b7062c7af |
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
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | |
<header class="entry-header clearfix"> | |
<h1 class="entry-title"><?php echo single_term_title(); ?></h1> | |
</header><!-- .entry-header --> | |
<?php | |
$term_description = term_description(); | |
if( $term_description ) : ?> | |
<div class="entry-content post-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 | |
/** | |
* replace one of the widget image sizes | |
* | |
* examples replaces the banner layout's image with the 'large' size image from Settings > Media | |
* | |
* If you replacing $size with a custom image size, you must register that separately with add_image_size() | |
* | |
* @param $size string slug of registered image size | |
* @return string|array slug of registered image size or "array( width, height )" (not recommended) |
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 a post type that can be featured in the Feature a Page Widget | |
* | |
* Any post types added via this filter automatically have support added for excerpts and featured images | |
* | |
* This example adds the ability to feature the "book" post type | |
* | |
* @param $post_types array array of post_type slugs that can be featured with the widget | |
*/ |
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 | |
/** | |
* modify the "Read More" text in the accessible "Read More" link | |
* | |
* example: change it to "Continue Reading" | |
* | |
* @param $read_more_text string The "________" in "________ about {Page Title}" | |
*/ | |
function fpw_change_read_more( $read_more_text ) { | |
$read_more_text = __( 'Continue Reading', 'your-text-domain' ); |
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 | |
/** | |
* remove a default template | |
* | |
* default templates are: big, banner, wrapped | |
* | |
* this example removes the "Big Image" template | |
* | |
* @param $templates array slug => label pairs of templates | |
*/ |
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 | |
/** | |
* Set fpw_auto_excerpt to TRUE to allow auto-generated excerpts if the Excerpt field is blank | |
* | |
* Uses the_excerpt() and associated filters. | |
*/ | |
add_filter( 'fpw_auto_excerpt', '__return_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
<?php | |
/** | |
* Events Navigation Bar Module Template | |
* Renders our events navigation bar used across our views | |
* | |
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/modules/bar.php | |
* | |
* $filters and $views variables are loaded in and coming from | |
* the show funcion in: lib/tribe-events-bar.class.php | |
* |
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 | |
remove_filter('tribe_events_single_event_after_the_content', array('TribeiCal', 'single_event_links'), 10, 1); | |
add_filter( 'tribe_events_single_event_after_the_meta', array('TribeiCal', 'single_event_links'), 10, 1); |