[Hack] A to Z Glossary Terms Starting With Numbers
-
Hi there,
This is a lovely plugin that I used for a client. Had a hell of a time trying to get numbers included with the A-Z Glossary Terms Shortcode. Gave the info to a good friend of mine Eric Baum to take a look and he managed to create a simple hack that places all glossary term posts starting with a number to be placed under a pound symbol “#”.
Below is the directions to get this working for you.
Open file wp-glossary.js and add this line of code below line 38.
//if( myAlpha.length ) try { $('.atoz-clickable').filter(function(i){return $(this).attr('alpha') == myAlpha;}).click(); } catch (err) { }
After you do that, open glossary-atoz-shortcode.php and add this line of code below line 30.
if (!ctype_alpha($alpha)) $alpha = '';
Add this below line 45.
$range = array_merge(Array(''), $range);
Add this below line 51.
$char = ($alpha == '') ? '#' : $alpha;
Add this below line 55.
$menu .= '<a href="#' . $alpha . '">' . $char . '</a></li>';
That’s it! When I get back to my home office, I’ll upload the files so you can download them without having to edit the actual code itself. I believe there are some additional if statements added as well. If anything, this will steer you in the right direction.
Enjoy!
- The topic ‘[Hack] A to Z Glossary Terms Starting With Numbers’ is closed to new replies.