The current plugin main page HTML structure is built as sperate list per letter, and due to the use of a translation service, I need it to be one global list.
Instead of having:
<ul id=”dw-glossary-A” class=”dw-glossary-items”><li class=”dw-glossary-title”>A</li><li class=”post-item” style=”width: 33%”>
<li class=”dw-glossary-title”>A</li><li class=”post-item” style=”width: 33%”>
<li class=”post-item” style=”width: 33%”>blabla</li>
I would like to have one ul tag for all terms, and have the separator built dynamically.
The question is how can I change the plugin code while still being able to update, or if there’s a way to do it using the current plugin.
In your case, you can edit in the dw-glossary.php file in the plugins/dw-glossary folder. then find the line 276 to line 287.
Replace with the following code:
if ( is_array( $result ) ) {
$content .= '<div class="dw-glossary-list">';
$content .= '<ul id="dw-glossary-'.$key.'" class="dw-glossary-items">';
foreach ( $result as $key => $value) {
$content .= '<li class="dw-glossary-title">'.$key.'</li>';
foreach ( $value as $item ) {
$content .= '<li class="post-item" style="width: '.$width.'"><a href="'.$item[1].'">'.$item[0].'</a></li>';
}
}
$content .= '</ul>';
$content .= '</div>';
}
Please login or Register to submit your answer