Changeset 371658
- Timestamp:
- 04/11/2011 06:13:06 PM (15 years ago)
- Location:
- genesis-post-teasers/trunk
- Files:
-
- 5 edited
-
css/teaserstyles.php (modified) (1 diff)
-
genesis-post-teasers.php (modified) (8 diffs)
-
js/settingslide.js (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
screenshot-1.jpg (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
genesis-post-teasers/trunk/css/teaserstyles.php
r371097 r371658 1 <?php header("Content-type: text/css"); 1 <?php 2 header("Content-type: text/css"); 2 3 3 if ( !$_GET['genesisopt_width'] ) { 4 $width = 300px; 5 } 4 $width = '48%'; 5 6 6 if ( $_GET['genesisopt_width'] && $_GET['genesisopt_no_pair'] == 0 ) { 7 $width = $_GET['genesisopt_width'];8 $width .= "px";7 $width = $_GET['genesisopt_width']; 8 $width .= "px"; 9 9 } 10 10 if ( $_GET['genesisopt_height'] == '' ) { 11 $height = "auto";11 $height = "auto"; 12 12 } else { 13 $height = $_GET['genesisopt_height'];14 $height .= "px";13 $height = $_GET['genesisopt_height']; 14 $height .= "px"; 15 15 } 16 16 17 17 if ( $_GET['genesisopt_no_pair'] == 1 ) { ?> 18 18 19 #post-teasers, .post-teasers-pair {20 clear:both;21 }22 #post-teasers .genesis-grid-even,23 #post-teasers .genesis-grid-odd {24 width:100%;25 float: none;26 height: auto;27 }19 #post-teasers, .post-teasers-pair { 20 clear:both; 21 } 22 #post-teasers .genesis-grid-even, 23 #post-teasers .genesis-grid-odd { 24 width:100%; 25 float: none; 26 height: auto; 27 } 28 28 29 29 <?php -
genesis-post-teasers/trunk/genesis-post-teasers.php
r371096 r371658 4 4 Plugin URI: http://genesistutorials.com/plug-ins/genesis-post-teasers/ 5 5 Description: Add theme settings for enabling teasers for the Genesis Theme Framework by studiopress. Uses genesis_grid_loop(); 6 Version: 1.0 b6 Version: 1.0 7 7 Author: Christopher Cochran 8 8 Author URI: http://christophercochran.me … … 20 20 21 21 } 22 23 add_filter('genesis_theme_settings_defaults', 'define_post_teasers_default_settings', 15, 2); 24 function define_post_teasers_default_settings($defaults) { 25 $defaults = array( 26 'teasers_enable' => 'Home Page', 27 'numof_posts_per_page' => 10, 28 'use_css' => 'pluginstyles', 29 'numof_full_posts' => 2, 30 'readmore_link_on_teasers' => '[Continue reading...]' 31 ); 32 return $defaults; 33 } 34 22 35 23 36 $gPostTeaz_full = false; … … 26 39 function enable_post_teaser_logic() { 27 40 if ( function_exists('genesis') ) { 28 global $gPostTeaz_full; 41 global $gPostTeaz_full; 42 43 if( genesis_get_option('teasers_enable') == 'Home Page' ) 44 $enableteaserson = is_home(); 45 if( genesis_get_option('teasers_enable') == 'Blog Template' ) 46 $enableteaserson = is_page_template( 'page_blog.php' ); 47 if( genesis_get_option('teasers_enable') == 'Archives' ) 48 $enableteaserson = is_archive(); 49 29 50 $gPostTeaz_full = genesis_get_option('numof_full_posts'); 30 31 if( genesis_get_option('teasers_enable') == 'Blog Template' ) { 32 if ( is_page_template( 'page_blog.php' ) ) { 33 remove_action( 'genesis_loop', 'genesis_do_loop' ); 34 remove_action( 'genesis_loop', 'focus_grid_loop_helper' ); 35 remove_action( 'genesis_loop', 'pretty_grid_loop_helper' ); 36 add_action( 'genesis_loop', 'gpt_grid_loop' ); 37 add_action('genesis_before_post','post_teaser_do_open', 10, 2); 38 if( genesis_get_option('no_pair_teasers') == 0 ) { 39 add_action('genesis_before_post','post_teaser_pertwo_wrap_open', 15, 2); 40 add_action('genesis_after_post','post_teaser_pertwo_wrap_openclose'); 41 add_action('genesis_after_endwhile','post_teaser_pertwo_wrap_close', 5, 2); 42 } 43 add_action('genesis_after_endwhile','post_teaser_do_close', 6, 2); 44 add_filter('genesis_options', 'define_content_archive_home_setting', 10, 2); 45 if( genesis_get_option('use_css') == 'pluginstyles' || genesis_get_option('no_pair_teasers') == 1 ) { 46 $genesis = $gPostTeaz_full; 47 $genesisopt_full_width = genesis_get_option('no_pair_teasers'); 48 $genesisopt_width = genesis_get_option('post_teaser_width'); 49 $genesisopt_height = genesis_get_option('post_teaser_height'); 50 wp_enqueue_style('teaserstyles', WP_PLUGIN_URL . "/genesis-post-teasers/css/teaserstyles.php?genesis=$genesis&genesisopt_width=$genesisopt_width&genesisopt_height=$genesisopt_height&genesisopt_no_pair=$genesisopt_full_width"); 51 } 52 if( genesis_get_option('disable_teaser_meta') == 1 ) { 53 remove_action('genesis_after_post_content', 'genesis_post_meta'); 54 add_filter('genesis_after_post_content', 'genesis_post_meta_teaser_logic'); 55 } 56 if( genesis_get_option( 'disable_teaser_info' ) == 1 ) { 57 remove_action( 'genesis_before_post_content', 'genesis_post_info' ); 58 add_filter( 'genesis_before_post_content', 'genesis_post_info_teaser_logic' ); 59 } 60 } 61 } 62 if( genesis_get_option('teasers_enable') == 'Home Page' ) { 63 if (is_home() ) { 64 remove_action( 'genesis_loop', 'genesis_do_loop' ); 65 remove_action( 'genesis_loop', 'focus_grid_loop_helper' ); 66 remove_action( 'genesis_loop', 'pretty_grid_loop_helper' ); 67 add_action( 'genesis_loop', 'gpt_grid_loop' ); 68 add_action('genesis_before_post','post_teaser_do_open', 10, 2); 69 if( genesis_get_option('no_pair_teasers') == 0 ) { 70 add_action('genesis_before_post','post_teaser_pertwo_wrap_open', 15, 2); 71 add_action('genesis_after_post','post_teaser_pertwo_wrap_openclose'); 72 add_action('genesis_after_endwhile','post_teaser_pertwo_wrap_close', 5, 2); 73 } 74 add_action('genesis_after_endwhile','post_teaser_do_close', 6, 2); 75 add_filter('genesis_options', 'define_content_archive_home_setting', 10, 2); 76 if( genesis_get_option('use_css') == 'pluginstyles' || genesis_get_option('no_pair_teasers') == 1 ) { 77 $genesis = $gPostTeaz_full; 78 $genesisopt_full_width = genesis_get_option('no_pair_teasers'); 79 $genesisopt_width = genesis_get_option('post_teaser_width'); 80 $genesisopt_height = genesis_get_option('post_teaser_height'); 81 wp_enqueue_style('teaserstyles', WP_PLUGIN_URL . "/genesis-post-teasers/css/teaserstyles.php?genesis=$genesis&genesisopt_width=$genesisopt_width&genesisopt_height=$genesisopt_height&genesisopt_no_pair=$genesisopt_full_width"); 82 } 83 if( genesis_get_option('disable_teaser_meta') == 1 ) { 84 remove_action('genesis_after_post_content', 'genesis_post_meta'); 85 add_filter('genesis_after_post_content', 'genesis_post_meta_teaser_logic'); 86 } 87 if( genesis_get_option( 'disable_teaser_info' ) == 1 ) { 88 remove_action( 'genesis_before_post_content', 'genesis_post_info' ); 89 add_filter( 'genesis_before_post_content', 'genesis_post_info_teaser_logic' ); 90 } 51 52 if ( $enableteaserson ) { 53 remove_action( 'genesis_loop', 'genesis_do_loop' ); 54 remove_action( 'genesis_loop', 'focus_grid_loop_helper' ); 55 remove_action( 'genesis_loop', 'pretty_grid_loop_helper' ); 56 add_action( 'genesis_loop', 'gpt_grid_loop' ); 57 add_action('genesis_before_post','post_teaser_do_open', 10, 2); 58 if( genesis_get_option('no_pair_teasers') == 0 ) { 59 add_action('genesis_before_post','post_teaser_pertwo_wrap_open', 15, 2); 60 add_action('genesis_after_post','post_teaser_pertwo_wrap_openclose'); 61 add_action('genesis_after_endwhile','post_teaser_pertwo_wrap_close', 5, 2); 62 } 63 add_action('genesis_after_endwhile','post_teaser_do_close', 6, 2); 64 add_filter('genesis_options', 'define_content_archive_home_setting', 10, 2); 65 if( genesis_get_option('no_pair_teasers') == 1 || genesis_get_option('use_css') == 'pluginstyles' ) { 66 $genesis = $gPostTeaz_full; 67 $genesisopt_full_width = genesis_get_option('no_pair_teasers'); 68 $genesisopt_width = genesis_get_option('post_teaser_width'); 69 $genesisopt_height = genesis_get_option('post_teaser_height'); 70 wp_enqueue_style('teaserstyles', WP_PLUGIN_URL . "/genesis-post-teasers/css/teaserstyles.php?genesis=$genesis&genesisopt_width=$genesisopt_width&genesisopt_height=$genesisopt_height&genesisopt_no_pair=$genesisopt_full_width"); 71 } 72 if( genesis_get_option('disable_teaser_meta') == 1 ) { 73 remove_action('genesis_after_post_content', 'genesis_post_meta'); 74 add_filter('genesis_after_post_content', 'genesis_post_meta_teaser_logic'); 75 } 76 if( genesis_get_option( 'disable_teaser_info' ) == 1 ) { 77 remove_action( 'genesis_before_post_content', 'genesis_post_info' ); 78 add_filter( 'genesis_before_post_content', 'genesis_post_info_teaser_logic' ); 91 79 } 92 80 } … … 196 184 // and to use teaser or not. 197 185 // If enable teasers is not checked none the previous code will run. 198 add_action('genesis_init', 'add_gPostTeaz_settings_init' );186 add_action('genesis_init', 'add_gPostTeaz_settings_init', 15 ); 199 187 function add_gPostTeaz_settings_init() { 200 add_action('admin_menu', 'gPostTeaz_settings_init' );188 add_action('admin_menu', 'gPostTeaz_settings_init' ); 201 189 } 202 190 … … 216 204 global $_genesis_theme_settings_pagehook; 217 205 218 add_meta_box('gPostTeaz _settings_box', 'Homepage Teasers', 'gPostTeaz_settings_box', $_genesis_theme_settings_pagehook, 'column2', 'high');206 add_meta_box('gPostTeaz-settings-box', 'Teaser Boxes Settings', 'gPostTeaz_settings_box', $_genesis_theme_settings_pagehook, 'column2', 'high' ); 219 207 } 220 208 … … 225 213 echo '<option style="padding-right: 10px;" value="Home Page" '.selected( 'Home Page', genesis_get_option('teasers_enable'), FALSE).'>Home Page</option>'; 226 214 echo '<option style="padding-right: 10px;" value="Blog Template" '.selected( 'Blog Template', genesis_get_option('teasers_enable'), FALSE).'>Blog Template</option>'; 215 echo '<option style="padding-right: 10px;" value="Archives" '.selected( 'Archives', genesis_get_option('teasers_enable'), FALSE).'>Archives</option>'; 227 216 ?> 228 217 </select></lable> … … 238 227 </p> 239 228 <p> 240 <span class="description">NOTE: "Plugin CSS" will allow you to change the teasers height and width. "Child Theme CSS" uses the defaultstyles in child theme for teasers widths and height.</span>229 <span class="description">NOTE: "Plugin CSS" will allow you to change the teasers height and width. "Child Theme CSS" uses the styles in child theme for teasers widths and height.</span> 241 230 </p> 242 231 <div class="css-opts <?php if ( genesis_get_option('use_css') === 'stylesheet' ) echo 'hidden' ?>"> 232 <p><input type="checkbox" name="<?php echo GENESIS_SETTINGS_FIELD; ?>[enable_custom_teaser_styles]" id="<?php echo GENESIS_SETTINGS_FIELD; ?>[enable_custom_teaser_styles]" value="1" <?php checked(1, genesis_get_option('enable_custom_teaser_styles')); ?> /> <label for="<?php echo GENESIS_SETTINGS_FIELD; ?>[enable_custom_teaser_styles]"><?php _e('Edit teaser styles?', 'genesis'); ?></label></p> 233 <div class="custom-css-opts <?php if ( genesis_get_option('enable_custom_teaser_styles') != 1 ) echo 'hidden' ?>"> 243 234 <hr class="div"> 244 235 <p><?php echo "Enter width for teaser boxes: "; ?> 245 236 <input type="text" name="<?php echo GENESIS_SETTINGS_FIELD; ?>[post_teaser_width]" value="<?php echo esc_attr( genesis_get_option('post_teaser_width') ); ?>" size="3" />px</p> 246 <p><span class="description">Depending on your layout or child theme you may want to change the width of your teasers. The default is 300. </span></p>237 <p><span class="description">Depending on your layout or child theme you may want to change the width of your teasers. By Default it will auto adjust. </span></p> 247 238 248 239 <p><?php echo "Enter height for teaser boxes: "; ?> 249 240 <input type="text" name="<?php echo GENESIS_SETTINGS_FIELD; ?>[post_teaser_height]" value="<?php echo esc_attr( genesis_get_option('post_teaser_height') ); ?>" size="3" />px</p> 250 241 <p><span class="description">If you want a defined height place here. By default the height will auto adjust. </span></p> 242 <p><span class="description">( NOTE: When teasers are not show in pairs you cannot edit the height or width from the plugin. ) </span></p> 243 244 </div> 251 245 </div> 252 246 <hr class="div"> … … 269 263 270 264 <hr class="div"> 271 <p ><input type="checkbox" name="<?php echo GENESIS_SETTINGS_FIELD; ?>[enable_teaser_thumbnail]" id="<?php echo GENESIS_SETTINGS_FIELD; ?>[enable_teaser_thumbnail]" value="1" <?php checked(1, genesis_get_option('enable_teaser_thumbnail')); ?> /> <label for="<?php echo GENESIS_SETTINGS_FIELD; ?>[enable_teaser_thumbnail]"><?php _e('Include thumbnails on teasers?', 'genesis'); ?></label></p>272 <p >265 <p class="enable-thumbnail"><input type="checkbox" name="<?php echo GENESIS_SETTINGS_FIELD; ?>[enable_teaser_thumbnail]" id="<?php echo GENESIS_SETTINGS_FIELD; ?>[enable_teaser_thumbnail]" value="1" <?php checked(1, genesis_get_option('enable_teaser_thumbnail')); ?> /> <label for="<?php echo GENESIS_SETTINGS_FIELD; ?>[enable_teaser_thumbnail]"><?php _e('Include thumbnails on teasers?', 'genesis'); ?></label></p> 266 <p style="padding-left: 20px;" class="select-image-size <?php if ( genesis_get_option('enable_teaser_thumbnail') == '' ) echo 'hidden' ?>"> 273 267 <?php _e("Image Size", 'genesis'); ?>: 274 268 <?php $sizes = genesis_get_additional_image_sizes(); ?> -
genesis-post-teasers/trunk/js/settingslide.js
r307557 r371658 1 1 jQuery(document).ready(function($) { 2 2 3 $("#gPostTeaz_settings_box input:radio:checked").live('load change', function() {3 jQuery("#gPostTeaz-settings-box input:radio:checked").live('load change', function() { 4 4 5 if ( $(this).val() == 'stylesheet' ) {6 $("#gPostTeaz_settings_box .css-opts").hide('fast');5 if ( jQuery(this).val() == 'stylesheet' ) { 6 jQuery("#gPostTeaz-settings-box .css-opts").hide('fast'); 7 7 } 8 8 9 if ( $(this).val() != 'stylesheet' ) { 10 $("#gPostTeaz_settings_box .css-opts").show('fast'); 9 if ( jQuery(this).val() != 'stylesheet' ) { 10 jQuery("#gPostTeaz-settings-box .css-opts").show('fast'); 11 } 12 13 }); 14 15 jQuery("#gPostTeaz-settings-box .css-opts input").live('load change', function() { 16 17 if ( jQuery(this).is(':checked')) { 18 jQuery("#gPostTeaz-settings-box .custom-css-opts").show('fast'); 19 } else { 20 jQuery("#gPostTeaz-settings-box .custom-css-opts").hide('fast'); 21 } 22 23 }); 24 25 jQuery("#gPostTeaz-settings-box .enable-thumbnail input").live('load change', function() { 26 27 if ( jQuery(this).is(':checked')) { 28 jQuery("#gPostTeaz-settings-box .select-image-size").show('fast'); 29 } else { 30 jQuery("#gPostTeaz-settings-box .select-image-size").hide('fast'); 11 31 } 12 32 -
genesis-post-teasers/trunk/readme.txt
r371094 r371658 7 7 Stable tag: trunk 8 8 9 This plugin auto generates post teasers for Genesis blog style homepages.9 This plugin uses the genesis grid loop function to display posts teasers either on your Homepage, Archives, or Blog Template and gives added options to control them. 10 10 11 11 == Description == 12 12 13 This plugin auto generates post teasers for Genesis blog style homepages. Easily display X amount of full posts before the teasers with following posts being excepts. The Genesis Theme Framework is Required.13 This plugin uses the genesis grid loop function to display posts teasers either on your Homepage, Archives, or Blog Template and gives added options to control them. Easily have 1,2,3... as many featured posts at top and teasers below. Enable Thumbnails, Disable the byline or post meta and limit the text for the teasers. The Genesis Theme Framework by studiopress is required. 14 14 15 15 == Installation == … … 22 22 == Frequently Asked Questions == 23 23 24 = What happens when I select Use CustomCSS? =24 = What happens when I select Use Plugin CSS? = 25 25 26 This plug in adds additional markup to style the post teasers. Selecting ' Use Custom CSS' will not load any the CSS provided nad require you to add your own to your child theme's style.css. By default The post teasers will be displayed in pairs side by side.26 This plug in adds additional markup to style the post teasers. Selecting 'Child Theme CSS' will not load any the CSS provided in the plugin and requires you to add your own to your child theme's style.css. By default The post teasers will be displayed in pairs side by side. 27 27 28 28 = The plug in seems to have done nothing for my site = 29 29 30 Make sure you have enabled posts teasers by checking 'Enable teasers on home page?' and 'Default CSS' selected. 31 32 *NOTE - This plug in will not work for widgetized homepages. 30 This Plugin will not work with widgetized homepages. If your homepage is widgetized try selecting "Archive" or "Blog Template". 33 31 34 32 == Screenshots == … … 51 49 * Added option to display teasers full width. 52 50 * Small bug fixes. 51 52 = 1.0 = 53 * Added ability to display teaser boxes on archives. 54 * Added default settings. 55 * Cleaned up settings widget. 56 * Fixed: Meta box didn't display in Genesis 1.6 57
Note: See TracChangeset
for help on using the changeset viewer.