From 0ec3ec56695d6aa664afbb1f1d6e5bc461c5ee37 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Fri, 18 Apr 2014 19:47:36 +1000 Subject: [PATCH] Add template loader to enable themed templates --- assets/css/menu.css | 2 +- assets/fonts/sportspress.eot | Bin 3732 -> 3732 bytes assets/fonts/sportspress.svg | 2 +- assets/fonts/sportspress.ttf | Bin 3552 -> 3552 bytes assets/fonts/sportspress.woff | Bin 2992 -> 2992 bytes includes/class-sp-template-loader.php | 152 ++++++++++++++ includes/sp-conditional-functions.php | 12 +- includes/sp-core-functions.php | 40 +++- includes/sp-template-functions.php | 255 +++++++++++++++++++++++- includes/sp-template-hooks.php | 176 +++++++--------- readme.txt | 2 +- sportspress.php | 7 +- templates/content-single-calendar.php | 27 +++ templates/content-single-event.php | 27 +++ templates/content-single-list.php | 27 +++ templates/content-single-player.php | 27 +++ templates/content-single-staff.php | 27 +++ templates/content-single-table.php | 27 +++ templates/content-single-team.php | 27 +++ templates/countdown.php | 10 + templates/event-calendar.php | 10 + templates/event-details.php | 10 + templates/event-list.php | 10 + templates/event-performance.php | 10 + templates/event-results.php | 10 + templates/event-staff.php | 10 + templates/event-venue.php | 20 +- templates/event-video.php | 10 + templates/event.php | 9 - templates/league-table.php | 10 + templates/player-gallery.php | 10 + templates/player-league-performance.php | 10 + templates/player-list.php | 10 + templates/player-metrics.php | 10 + templates/player-performance.php | 10 + templates/player-roster.php | 10 + templates/player.php | 6 - templates/team-columns.php | 10 + templates/venue-map.php | 23 +++ 39 files changed, 916 insertions(+), 139 deletions(-) create mode 100644 includes/class-sp-template-loader.php create mode 100644 templates/content-single-calendar.php create mode 100644 templates/content-single-event.php create mode 100644 templates/content-single-list.php create mode 100644 templates/content-single-player.php create mode 100644 templates/content-single-staff.php create mode 100644 templates/content-single-table.php create mode 100644 templates/content-single-team.php delete mode 100644 templates/event.php delete mode 100644 templates/player.php create mode 100644 templates/venue-map.php diff --git a/assets/css/menu.css b/assets/css/menu.css index 444ce19d..946d646b 100644 --- a/assets/css/menu.css +++ b/assets/css/menu.css @@ -40,7 +40,7 @@ content: "\f307"; } .sp-icon-megaphone:before { - content: "\f322"; + content: "\f155"; } .sp-icon-crown:before { content: "\f313"; diff --git a/assets/fonts/sportspress.eot b/assets/fonts/sportspress.eot index 4bfda4397f7ad97d23b516925b09f9988cb8aeb3..fc7c306e7758b6acd1c8db13a3ab8739221c6bfa 100755 GIT binary patch delta 153 zcmbOtJ4JSa4GZJv7RiYYQ&{#M-g9u`4PE9>OphjWFzPZt;g*?f!FX6T^ked8_Rqqf zRX=NdHu;kI|L_0*3?QKJQShVdN2u&%1twAUjeJXZ8F{{KwqYt|+`N#@hjH^p<_}Dp v-?B%u$QbwR7l`M#`O3h}1lE1N_#r=t0iq|T@YJy}dN9soJhu4-&l*Mm-u*gd delta 153 zcmbOtJ4JSa4U45>fb2wvDJ=WT_S~L$Lznqc@r=nFjJnKe+zOK|7!Ru^e`fzI{8{O< z>SvA5CSNlD|NZ};0R$923Vw9`2$h|zz$D7Pn3sX)E6?-IHcX|AoBy(WVA{Nq*@toS vTlQ!c8AHdr8S(r!Um3WWz`D=pNM?Z;AbN5NPaPY>4@Lzhsm(8V)-VD95`8!K diff --git a/assets/fonts/sportspress.svg b/assets/fonts/sportspress.svg index 4bab3f7e..0e3490dd 100755 --- a/assets/fonts/sportspress.svg +++ b/assets/fonts/sportspress.svg @@ -9,10 +9,10 @@ + - diff --git a/assets/fonts/sportspress.ttf b/assets/fonts/sportspress.ttf index 84cc362b0d81f9bb01c9eb3f41de44e0912890e5..cf58e1140f11d1ebeba2ee62c91ab69b822e880f 100755 GIT binary patch delta 141 zcmaDL{Xlwx0?XdRdk#)i(PjR`^k`y;F7p#^nTaij*+V}je`fzIJlT&?Tp7y#tom8w zv&omt|9}7gXJGvQnC~;+0ltlVOL!T1zHRPcEM?sMmeq%G^IxV9Oq(s)qgiB(d-e;& k^V@u7;AUa~f%C-=`C;_r4cv8Xj2?{h7>{i>;aS5702s44DF6Tf delta 141 zcmaDL{Xlwx0?YogJ+~*S=rTVlo-r{*mpP4FVPeZ+_TeR(2gmxU%esIcrkyyxJ=3{~b&Ophi`_{wNHxsg$1@+?M8)~!q~Otq6w zF#ei6iRH-VLrfPLH;1#HVfGFEnEaXjv+!rt&l;aizGVLY`~N=!2q=6M{OI}-n=Ir1 z$9$jp4)AT{Tf)o8^Nr^z&tsk&+)Egk85k!Qa>`8Z;S`XOZ28O>&u{aUftv|z+WF## O{2&I1-n@hJ2O|J_TTLVY delta 195 zcmdlWzCnC~4a?zz(`pkPR9NG&Uv(jhP&l;aizGVLY`~N=!2q=6M z{OI}-n=Ir1$9$jp4)87JW#IYB^PJ}?&tsk&+)Egk85k!Qa>`8Z;S`XO4N$a<=ePOF Wz|90U?R<`87Kj0&H}By5!3Y4G?oKfP diff --git a/includes/class-sp-template-loader.php b/includes/class-sp-template-loader.php new file mode 100644 index 00000000..0091cfdc --- /dev/null +++ b/includes/class-sp-template-loader.php @@ -0,0 +1,152 @@ +taxonomy . '.php'; + $find[] = 'taxonomy-' . $term->taxonomy . '-' . $term->slug . '.php'; + $find[] = SP_TEMPLATE_PATH . 'taxonomy-' . $term->taxonomy . '-' . $term->slug . '.php'; + $find[] = $file; + $find[] = SP_TEMPLATE_PATH . $file; + + endif; + + if ( $file ): + $located = locate_template( $find ); + if ( $located ): + $template = $located; + endif; + endif; + + return $template; + } +} + +new SP_Template_Loader(); + \ No newline at end of file diff --git a/includes/sp-conditional-functions.php b/includes/sp-conditional-functions.php index ca0930ab..be00cd3b 100644 --- a/includes/sp-conditional-functions.php +++ b/includes/sp-conditional-functions.php @@ -7,11 +7,21 @@ * @author ThemeBoy * @category Core * @package SportsPress/Functions - * @version 0.7 + * @version 0.8 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +/** + * is_sportspress - Returns true if on a page which uses SportsPress templates + * + * @access public + * @return bool + */ +function is_sportspress() { + return apply_filters( 'is_sportspress', ( is_singular( array( 'sp_event', 'sp_calendar', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) ) ) ? true : false ); +} + if ( ! function_exists( 'is_ajax' ) ) { /** diff --git a/includes/sp-core-functions.php b/includes/sp-core-functions.php index ecdb7f85..0cc2c58a 100644 --- a/includes/sp-core-functions.php +++ b/includes/sp-core-functions.php @@ -7,7 +7,7 @@ * @author ThemeBoy * @category Core * @package SportsPress/Functions - * @version 0.7 + * @version 0.8 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -17,6 +17,40 @@ include( 'sp-conditional-functions.php' ); include( 'sp-formatting-functions.php' ); include( 'sp-deprecated-functions.php' ); +/** + * Get template part. + * + * @access public + * @param mixed $slug + * @param string $name (default: '') + * @return void + */ +function sp_get_template_part( $slug, $name = '' ) { + $template = ''; + + // Look in yourtheme/slug-name.php and yourtheme/sportspress/slug-name.php + if ( $name ) { + $template = locate_template( array( "{$slug}-{$name}.php", SP()->template_path() . "{$slug}-{$name}.php" ) ); + } + + // Get default slug-name.php + if ( ! $template && $name && file_exists( SP()->plugin_path() . "/templates/{$slug}-{$name}.php" ) ) { + $template = SP()->plugin_path() . "/templates/{$slug}-{$name}.php"; + } + + // If template file doesn't exist, look in yourtheme/slug.php and yourtheme/sportspress/slug.php + if ( ! $template ) { + $template = locate_template( array( "{$slug}.php", SP()->template_path() . "{$slug}.php" ) ); + } + + // Allow 3rd party plugin filter template file from their plugin + $template = apply_filters( 'sp_get_template_part', $template, $slug, $name ); + + if ( $template ) { + load_template( $template, false ); + } +} + /** * Get templates passing attributes and including the file. * @@ -973,7 +1007,7 @@ if ( !function_exists( 'sp_edit_league_table' ) ) { ?> - + @@ -5198,7 +5232,7 @@ function sp_get_sport_presets() { ), array( 'post_title' => 'Yellow Cards', - 'post_name' => 'yellowcards', + 'post_name' => 'yellospards', 'meta' => array( 'sp_calculate' => 'total', ), diff --git a/includes/sp-template-functions.php b/includes/sp-template-functions.php index 92cc684b..fe86b722 100644 --- a/includes/sp-template-functions.php +++ b/includes/sp-template-functions.php @@ -7,7 +7,260 @@ * @author ThemeBoy * @category Core * @package SportsPress/Functions - * @version 0.7 + * @version 0.8 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly + +/** + * Output generator tag to aid debugging. + * + * @access public + * @return void + */ +function sp_generator_tag( $gen, $type ) { + switch ( $type ) { + case 'html': + $gen .= "\n" . ''; + break; + case 'xhtml': + $gen .= "\n" . ''; + break; + } + return $gen; +} + +/** + * Add body classes for SP pages + * + * @param array $classes + * @return array + */ +function sp_body_class( $classes ) { + $classes = (array) $classes; + + if ( is_sportspress() ) { + $classes[] = 'sportspress'; + $classes[] = 'sportspress-page'; + } + + return array_unique( $classes ); +} + +/** Template pages ********************************************************/ + +if ( ! function_exists( 'sportspress_taxonomy_archive_description' ) ) { + + /** + * Show an archive description on taxonomy archives + * + * @access public + * @subpackage Archives + * @return void + */ + function sportspress_taxonomy_archive_description() { + echo 'test'; + if ( is_tax( array( 'sp_season', 'sp_league', 'sp_venue', 'sp_position' ) ) && get_query_var( 'paged' ) == 0 ) { + $description = apply_filters( 'the_content', term_description() ); + if ( $description ) { + echo '
' . $description . '
'; + } + } + } +} + +/** Single Event ********************************************************/ + +if ( ! function_exists( 'sportspress_output_event_video' ) ) { + + /** + * Output the event video. + * + * @access public + * @subpackage Event/Video + * @return void + */ + function sportspress_output_event_video() { + sp_get_template( 'event-video.php' ); + } +} +if ( ! function_exists( 'sportspress_output_event_results' ) ) { + + /** + * Output the event results. + * + * @access public + * @subpackage Event/Results + * @return void + */ + function sportspress_output_event_results() { + sp_get_template( 'event-results.php' ); + } +} +if ( ! function_exists( 'sportspress_output_event_details' ) ) { + + /** + * Output the event details. + * + * @access public + * @subpackage Event/Details + * @return void + */ + function sportspress_output_event_details() { + sp_get_template( 'event-details.php' ); + } +} +if ( ! function_exists( 'sportspress_output_event_venue' ) ) { + + /** + * Output the event venue. + * + * @access public + * @subpackage Event/Venue + * @return void + */ + function sportspress_output_event_venue() { + sp_get_template( 'event-venue.php' ); + } +} +if ( ! function_exists( 'sportspress_output_event_performance' ) ) { + + /** + * Output the event performance. + * + * @access public + * @subpackage Event/Performance + * @return void + */ + function sportspress_output_event_performance() { + sp_get_template( 'event-performance.php' ); + } +} + +/** Single Calendar ********************************************************/ + +if ( ! function_exists( 'sportspress_output_calendar' ) ) { + + /** + * Output the calendar. + * + * @access public + * @subpackage Calendar + * @return void + */ + function sportspress_output_calendar() { + $id = get_the_ID(); + $format = get_post_meta( $id, 'sp_format', true ); + switch ( $format ): + case 'list': + sp_get_template( 'event-list.php', array( 'id' => $id ) ); + break; + default: + sp_get_template( 'event-calendar.php', array( 'id' => $id ) ); + break; + endswitch; + } +} + +/** Single Team ********************************************************/ + +if ( ! function_exists( 'sportspress_output_team_columns' ) ) { + + /** + * Output the team columns. + * + * @access public + * @subpackage Team/Columns + * @return void + */ + function sportspress_output_team_columns() { + sp_get_template( 'team-columns.php' ); + } +} + +/** Single League Table ********************************************************/ + +if ( ! function_exists( 'sportspress_output_league_table' ) ) { + + /** + * Output the team columns. + * + * @access public + * @subpackage Table + * @return void + */ + function sportspress_output_league_table() { + sp_get_template( 'league-table.php' ); + } +} + +/** Single Player ********************************************************/ + +if ( ! function_exists( 'sportspress_output_player_metrics' ) ) { + + /** + * Output the player metrics. + * + * @access public + * @subpackage Player/Metrics + * @return void + */ + function sportspress_output_player_metrics() { + sp_get_template( 'player-metrics.php' ); + } +} +if ( ! function_exists( 'sportspress_output_player_performance' ) ) { + + /** + * Output the player performance. + * + * @access public + * @subpackage Player/Performance + * @return void + */ + function sportspress_output_player_performance() { + sp_get_template( 'player-performance.php' ); + } +} + +/** Single Player List ********************************************************/ + +if ( ! function_exists( 'sportspress_output_player_list' ) ) { + + /** + * Output the player list. + * + * @access public + * @subpackage List + * @return void + */ + function sportspress_output_player_list() { + $id = get_the_ID(); + $format = get_post_meta( $id, 'sp_format', true ); + switch ( $format ): + case 'gallery': + sp_get_template( 'player-gallery.php', array( 'id' => $id ) ); + break; + default: + sp_get_template( 'player-list.php', array( 'id' => $id ) ); + break; + endswitch; + } +} + +/** Venue Archive ********************************************************/ + +function sportspress_output_venue_map( $query ) { + if ( ! is_tax( 'sp_venue' ) ) + return; + + $slug = sp_array_value( $query->query, 'sp_venue', null ); + + if ( ! $slug ) + return; + + $venue = get_term_by( 'slug', $slug, 'sp_venue' ); + $t_id = $venue->term_id; + $meta = get_option( "taxonomy_$t_id" ); + sp_get_template( 'venue-map.php', array( 'meta' => $meta ) ); +} diff --git a/includes/sp-template-hooks.php b/includes/sp-template-hooks.php index 28f13008..d46d789f 100644 --- a/includes/sp-template-hooks.php +++ b/includes/sp-template-hooks.php @@ -7,31 +7,77 @@ * @author ThemeBoy * @category Core * @package SportsPress/Functions - * @version 0.7 + * @version 0.8 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly -function sportspress_default_venue_content( $query ) { - if ( ! is_tax( 'sp_venue' ) ) - return; +add_filter( 'body_class', 'sp_body_class' ); - $slug = sp_array_value( $query->query, 'sp_venue', null ); +/** + * WP Header + * + * @see sp_generator_tag() + */ +add_action( 'get_the_generator_html', 'sp_generator_tag', 10, 2 ); +add_action( 'get_the_generator_xhtml', 'sp_generator_tag', 10, 2 ); - if ( ! $slug ) - return; +/** + * Single Event Content + * + * @see sportspress_output_event_video() + * @see sportspress_output_event_results() + * @see sportspress_output_event_details() + * @see sportspress_output_event_venue() + * @see sportspress_output_event_performance() + */ +add_action( 'sportspress_single_event_content', 'sportspress_output_event_video', 10 ); +add_action( 'sportspress_single_event_content', 'sportspress_output_event_results', 20 ); +add_action( 'sportspress_single_event_content', 'sportspress_output_event_details', 30 ); +add_action( 'sportspress_single_event_content', 'sportspress_output_event_venue', 40 ); +add_action( 'sportspress_single_event_content', 'sportspress_output_event_performance', 50 ); - $venue = get_term_by( 'slug', $slug, 'sp_venue' ); - $t_id = $venue->term_id; - $venue_meta = get_option( "taxonomy_$t_id" ); - $address = sp_array_value( $venue_meta, 'sp_address', null ); - $latitude = sp_array_value( $venue_meta, 'sp_latitude', null ); - $longitude = sp_array_value( $venue_meta, 'sp_longitude', null ); +/** + * Single Calendar Content + * + * @see sportspress_output_calendar() + */ +add_action( 'sportspress_single_calendar_content', 'sportspress_output_calendar', 10 ); - if ( $latitude != null && $longitude != null ) - echo '
'; -} -add_action( 'loop_start', 'sportspress_default_venue_content' ); +/** + * Single Team Content + * + * @see sportspress_output_team_columns() + */ +add_action( 'sportspress_single_team_content', 'sportspress_output_team_columns', 10 ); + +/** + * Single Table Content + * + * @see sportspress_output_league_table() + */ +add_action( 'sportspress_single_table_content', 'sportspress_output_league_table', 10 ); + +/** + * Single Player Content + * + * @see sportspress_output_player_metrics() + * @see sportspress_output_player_performance() + */ +add_action( 'sportspress_single_player_content', 'sportspress_output_player_metrics', 10 ); +add_action( 'sportspress_single_player_content', 'sportspress_output_player_performance', 20 ); + +/** + * Single List Content + * + * @see sportspress_output_player_list() + */ +add_action( 'sportspress_single_list_content', 'sportspress_output_player_list', 10 ); + +/** + * Venue Archive Content + */ +add_action( 'loop_start', 'sportspress_output_venue_map' ); function sportspress_the_title( $title, $id ) { if ( is_singular( 'sp_player' ) && in_the_loop() && $id == get_the_ID() ): @@ -152,104 +198,16 @@ function sportspress_sanitize_title( $title ) { } add_filter( 'sanitize_title', 'sportspress_sanitize_title' ); -function sportspress_the_content( $content ) { +function sportspress_content_post_views( $content ) { if ( is_single() || is_page() ) sp_set_post_views( get_the_ID() ); return $content; } -add_filter( 'the_content', 'sportspress_the_content' ); -add_filter( 'get_the_content', 'sportspress_the_content' ); - -function sportspress_default_event_content( $content ) { - if ( is_singular( 'sp_event' ) && in_the_loop() ) - sp_get_template( 'event.php' ); - - return $content; -} -add_filter( 'the_content', 'sportspress_default_event_content', 7 ); - -function sportspress_default_calendar_content( $content ) { - if ( is_singular( 'sp_calendar' ) && in_the_loop() ): - $id = get_the_ID(); - $format = get_post_meta( $id, 'sp_format', true ); - switch ( $format ): - case 'list': - sp_get_template( 'event-list.php', array( - 'id' => $id - ) ); - break; - default: - sp_get_template( 'event-calendar.php', array( - 'id' => $id, - 'initial' => false - ) ); - break; - endswitch; - endif; - return $content; -} -add_filter( 'the_content', 'sportspress_default_calendar_content' ); - -function sportspress_default_team_content( $content ) { - if ( is_singular( 'sp_team' ) && in_the_loop() ): - sp_get_template( 'team-columns.php' ); - endif; - return $content; -} -add_filter( 'the_content', 'sportspress_default_team_content' ); - -function sportspress_default_table_content( $content ) { - if ( is_singular( 'sp_table' ) && in_the_loop() ): - $id = get_the_ID(); - $leagues = get_the_terms( $id, 'sp_league' ); - $seasons = get_the_terms( $id, 'sp_season' ); - $terms = array(); - if ( $leagues ): - $league = reset( $leagues ); - $terms[] = $league->name; - endif; - if ( $seasons ): - $season = reset( $seasons ); - $terms[] = $season->name; - endif; - $title = ''; - if ( sizeof( $terms ) ) - echo '

' . implode( ' — ', $terms ) . '

'; - - sp_get_template( 'league-table.php' ); - $excerpt = has_excerpt() ? wpautop( get_the_excerpt() ) : ''; - $content = $content . $excerpt; - endif; - return $content; -} -add_filter( 'the_content', 'sportspress_default_table_content' ); - -function sportspress_default_player_content( $content ) { - if ( is_singular( 'sp_player' ) && in_the_loop() ) - sp_get_template( 'player.php' ); - return $content; -} -add_filter( 'the_content', 'sportspress_default_player_content' ); - -function sportspress_default_list_content( $content ) { - if ( is_singular( 'sp_list' ) && in_the_loop() ): - $id = get_the_ID(); - $format = get_post_meta( $id, 'sp_format', true ); - switch ( $format ): - case 'gallery': - sp_get_template( 'player-gallery.php' ); - break; - default: - sp_get_template( 'player-list.php' ); - break; - endswitch; - endif; - return $content; -} -add_filter( 'the_content', 'sportspress_default_list_content' ); +add_filter( 'the_content', 'sportspress_content_post_views' ); +add_filter( 'get_the_content', 'sportspress_content_post_views' ); function sportspress_widget_text( $content ) { - if ( ! preg_match( '/\[[\r\n\t ]*(countdown|league_table|event(s)_(calendar|list)|player_(list|gallery))?[\r\n\t ].*?\]/', $content ) ) + if ( ! preg_match( '/\[[\r\n\t ]*(countdown|league(_|-)table|events?(_|-)(calendar|list)|player(_|-)(list|gallery))?[\r\n\t ].*?\]/', $content ) ) return $content; $content = do_shortcode( $content ); diff --git a/readme.txt b/readme.txt index 1290a950..19dbb3ac 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: ThemeBoy Tags: sports, press, sports journalism, teams, team management, fixtures, results, standings, league tables, leagues, reporting, themeboy, wordpress sports, configurable Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=support@themeboy.com&item_name=Donation+for+SportsPress Requires at least: 3.8 -Tested up to: 3.8.2 +Tested up to: 3.9 Stable tag: 0.8 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html diff --git a/sportspress.php b/sportspress.php index 99c247f3..a7f08ecd 100644 --- a/sportspress.php +++ b/sportspress.php @@ -7,7 +7,7 @@ * Author: ThemeBoy * Author URI: http://themeboy.com * Requires at least: 3.8 - * Tested up to: 3.8 + * Tested up to: 3.9 * * Text Domain: sportspress * Domain Path: /languages/ @@ -119,6 +119,7 @@ final class SportsPress { add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'action_links' ) ); add_action( 'widgets_init', array( $this, 'include_widgets' ) ); add_action( 'init', array( $this, 'init' ), 0 ); + add_action( 'init', array( $this, 'include_template_functions' ) ); add_action( 'init', array( 'SP_Shortcodes', 'init' ) ); add_action( 'after_setup_theme', array( $this, 'setup_environment' ) ); @@ -220,6 +221,7 @@ final class SportsPress { * Include required frontend files. */ public function frontend_includes() { + include_once( 'includes/class-sp-template-loader.php' ); // Template Loader include_once( 'includes/class-sp-frontend-scripts.php' ); // Frontend Scripts include_once( 'includes/class-sp-shortcodes.php' ); // Shortcodes class } @@ -298,7 +300,8 @@ final class SportsPress { // Fit (Proportional) add_image_size( 'sportspress-fit', 637, 637, false ); add_image_size( 'sportspress-fit-thumbnail', 303, 303, false ); - add_image_size( 'sportspress-fit-icon', 32, 32, false ); + add_image_size( 'sportspress-fit-icon', 128, 128, false ); + add_image_size( 'sportspress-fit-mini', 32, 32, false ); } /** Helper functions ******************************************************/ diff --git a/templates/content-single-calendar.php b/templates/content-single-calendar.php new file mode 100644 index 00000000..86f3fbdf --- /dev/null +++ b/templates/content-single-calendar.php @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/templates/content-single-event.php b/templates/content-single-event.php new file mode 100644 index 00000000..c3cb2f45 --- /dev/null +++ b/templates/content-single-event.php @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/templates/content-single-list.php b/templates/content-single-list.php new file mode 100644 index 00000000..15c86b46 --- /dev/null +++ b/templates/content-single-list.php @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/templates/content-single-player.php b/templates/content-single-player.php new file mode 100644 index 00000000..f2bdf259 --- /dev/null +++ b/templates/content-single-player.php @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/templates/content-single-staff.php b/templates/content-single-staff.php new file mode 100644 index 00000000..75ee67be --- /dev/null +++ b/templates/content-single-staff.php @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/templates/content-single-table.php b/templates/content-single-table.php new file mode 100644 index 00000000..17940bb5 --- /dev/null +++ b/templates/content-single-table.php @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/templates/content-single-team.php b/templates/content-single-team.php new file mode 100644 index 00000000..fd497f82 --- /dev/null +++ b/templates/content-single-team.php @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/templates/countdown.php b/templates/countdown.php index 231ab741..9fa426b5 100644 --- a/templates/countdown.php +++ b/templates/countdown.php @@ -1,4 +1,14 @@ null, 'live' => get_option( 'sportspress_enable_live_countdowns', 'yes' ) == 'yes' ? true : false, diff --git a/templates/event-calendar.php b/templates/event-calendar.php index d924ba0b..0e9b1bad 100644 --- a/templates/event-calendar.php +++ b/templates/event-calendar.php @@ -1,4 +1,14 @@ term_id; - $term_meta = get_option( "taxonomy_$t_id" ); + $meta = get_option( "taxonomy_$t_id" ); $name = $venue->name; if ( $link_venues ) $name = '' . $name . ''; - $address = sp_array_value( $term_meta, 'sp_address', '' ); - $latitude = sp_array_value( $term_meta, 'sp_latitude', 0 ); - $longitude = sp_array_value( $term_meta, 'sp_longitude', 0 ); + $address = sp_array_value( $meta, 'sp_address', '' ); + $latitude = sp_array_value( $meta, 'sp_latitude', 0 ); + $longitude = sp_array_value( $meta, 'sp_longitude', 0 ); ?>

text->string('Venue', 'event'); ?>

@@ -36,7 +46,7 @@ foreach( $venues as $venue ): - + diff --git a/templates/event-video.php b/templates/event-video.php index 1efda659..913cb828 100644 --- a/templates/event-video.php +++ b/templates/event-video.php @@ -1,4 +1,14 @@ $id ) ); -sp_get_template( 'event-results.php', array( 'id' => $id ) ); -sp_get_template( 'event-details.php', array( 'id' => $id ) ); -sp_get_template( 'event-venue.php', array( 'id' => $id ) ); -sp_get_template( 'event-performance.php', array( 'id' => $id ) ); diff --git a/templates/league-table.php b/templates/league-table.php index 312e4b32..4e93d534 100644 --- a/templates/league-table.php +++ b/templates/league-table.php @@ -1,4 +1,14 @@ get_the_ID(), 'number' => -1, diff --git a/templates/player-gallery.php b/templates/player-gallery.php index 26c55ee9..29cf8fba 100644 --- a/templates/player-gallery.php +++ b/templates/player-gallery.php @@ -1,4 +1,14 @@ get_the_ID(), 'number' => -1, diff --git a/templates/player-league-performance.php b/templates/player-league-performance.php index 7d5bd788..1b84757c 100644 --- a/templates/player-league-performance.php +++ b/templates/player-league-performance.php @@ -1,4 +1,14 @@ get_the_ID(), 'number' => -1, diff --git a/templates/player-metrics.php b/templates/player-metrics.php index 936cf4bb..600ddb25 100644 --- a/templates/player-metrics.php +++ b/templates/player-metrics.php @@ -1,4 +1,14 @@ $id ) ); -sp_get_template( 'player-performance.php', array( 'id' => $id ) ); diff --git a/templates/team-columns.php b/templates/team-columns.php index 0974c3f0..b9a0fa77 100644 --- a/templates/team-columns.php +++ b/templates/team-columns.php @@ -1,4 +1,14 @@ +
+
$meta ) ); ?>