Changeset 1843147
- Timestamp:
- 03/19/2018 10:47:23 PM (8 years ago)
- Location:
- multiple-excerpt-lengths/trunk
- Files:
-
- 2 edited
-
multiple-excerpt-lengths.php (modified) (5 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
multiple-excerpt-lengths/trunk/multiple-excerpt-lengths.php
r1337677 r1843147 3 3 /* 4 4 Plugin Name: Multiple Excerpt Lengths 5 Plugin URI: https://raajtram.com/plugins/mel 5 Plugin URI: https://raajtram.com/plugins/mel/ 6 6 Description: Allows you to change the lengths of excerpts that are present at variours pages/templates throughout your site. 7 Version: 1. 07 Version: 1.1 8 8 Author: Raaj Trambadia 9 9 Author URI: https://raajtram.com/ … … 63 63 64 64 add_settings_field( 65 'mel_search', 66 'Search Pages', 67 'mel_search_cb', 68 'multiple-excerpt-lengths', 69 'mel_section' 70 ); 71 72 add_settings_field( 65 73 'mel_tax', 66 74 'Custom Taxinomy Archives', … … 106 114 if( !isset( $options['on_author'] ) ) $options['on_author'] = ''; 107 115 echo '<input type="number" name="mel_settings[on_author]" value="' . $options['on_author'] . '" placeholder="55" min="1" max="999">'; 116 } 117 118 function mel_search_cb() { 119 $options = get_option( 'mel_settings' ); 120 if( !isset( $options['on_search'] ) ) $options['on_search'] = ''; 121 echo '<input type="number" name="mel_settings[on_search]" value="' . $options['on_search'] . '" placeholder="55" min="1" max="999">'; 108 122 } 109 123 … … 158 172 $is_tag = !empty( $options['on_tag'] ) ? $options['on_tag'] : '55'; 159 173 $is_author = !empty( $options['on_author'] ) ? $options['on_author'] : '55'; 174 $is_search = !empty( $options['on_search'] ) ? $options['on_search'] : '55'; 160 175 $is_tax = !empty( $options['on_tax'] ) ? $options['on_tax'] : '55'; 161 176 … … 175 190 return '' . $is_author . ''; 176 191 } 192 elseif(is_search()) { 193 return '' . $is_search . ''; 194 } 177 195 elseif(is_tax()) { 178 196 return '' . $is_tax . ''; -
multiple-excerpt-lengths/trunk/readme.txt
r1337677 r1843147 16 16 Do you have excerpts on multiple pages? Do you want to have them at different lengths? 17 17 18 With the Multiple Excerpt Lengths plugin, you can now control the length (in words) of excerpts present at various different templates throughout your WordPress site. 18 With the Multiple Excerpt Lengths plugin, you can now control the length (in words) of excerpts present at various different templates throughout your WordPress site. 19 19 20 By default, **WordPress sets the length of excerpts at 55 words**. It is fairly simple to change this length – it only requires you to add a short piece of code to your functions.php file. However, once you add that code, it changes the length of **ALL** the excerpts present on your site, and you may not want that. 20 By default, **WordPress sets the length of excerpts at 55 words**. It is fairly simple to change this length – it only requires you to add a short piece of code to your functions.php file. However, once you add that code, it changes the length of **ALL** the excerpts present on your site, and you may not want that. 21 21 22 22 For example, you might want to shorten the length of the excerpts on your Front Page where you have 3 recent blog posts displayed horizontally in columns but you might not want to change the length of the excerpts on your Blog Page (which may be displaying 10 of your recent posts). … … 52 52 == Changelog == 53 53 54 = 1.1 = 55 *Added support for Search pages 56 54 57 = 1.0 = 55 58 *Plugin Released … … 57 60 == Upgrade Notice == 58 61 62 = 1.1 = 63 This version adds support for Search pages 64 59 65 = 1.0 = 60 66 Plugin Released
Note: See TracChangeset
for help on using the changeset viewer.