a h3 node casually added in the widget
-
Bhaldie, I still have 2 small issues in the widget (see here):
1) a small h3 tag that came out of the blue, where the mdocs-hide-widget-titles tag is located (I have set it to hide the title).
2) the first files I uploaded don’t go away as new files are added.
You could inspect the widget on any page of my site.
Looking forward to your advice. Thanks
-
…sorry, maybe you have overlooked this topic but I have investigated deeply and the <h3> tag is really thrown in by this plugin. Also, my files are not updated in the widget and the solution of re-saving it doesn’t work.
I have lots of cron-daemon emails telling me that “Premature output is preventing Memphis Documents Library from working properly. Outputs has started in on line 0.”
Please give me advice, thanks.
its not the plugin that is the problem it is the why you have created you widget using the function register_sidebar.
Please read the WordPress documentation on register_sidebar looking closely at before_title arg, by default it is set to an <h3> tag:
https://codex.ww.wp.xz.cn/Function_Reference/register_sidebar
but how do you explain that if I add another widget instead of Memphis, it doesn’t add that h3 ? :S
because you are not creating your widgets properly. Here is what a widget is supppose to look like:
if(!isset($instance['lu-count'])) $instance['lu-count'] = 5; $mdocs = get_option('mdocs-list'); $the_list = mdocs_array_sort($mdocs,'modified', SORT_DESC, true); extract($args, EXTR_SKIP); echo $before_widget; echo $before_title; //Display title as stored in this instance of the widget if(get_option('mdocs-hide-widget-titles') == false) _e('Last Updated', 'memphis-documents-library'); echo $after_title; ?> <table class="table table-condensed mdocs-widget-table"> <tr> <?php if(get_option('mdocs-hide-widget-column-titles') == false) { ?> <?php if(get_option('mdocs-hide-widget-numbers') == false) { ?><th></th><?php } ?> <th>File</th> <th>Date</th> <?php } ?> </tr> <?php $item_index = 1; for($i=0; $i< $instance['lu-count']; $i++) { if(!isset($the_list[$i])) break; if($the_list[$i]['file_status'] == 'public' || $instance['lu-show-all'] == 'on') { $permalink = mdocs_get_permalink($the_list[$i]['parent']); echo '<tr>'; if(get_option('mdocs-hide-widget-numbers') == false) echo '<td >'.($item_index).'.</td>'; echo '<td><a href="'.$permalink.'null" >'.$the_list[$i]['name'].'</a></td>'; echo '<td class="mdocs-widget-date" ><small>'.date(get_option('mdocs-date-format'), $the_list[$i]['modified']).'</small></td>'; echo '</tr>'; $item_index++; } else $instance['lu-count']++; } ?> </table> <?php echo $after_widget;my guess is you have just hard coded you widgets disregarded the WordPress standard for creating widgets. This method is done so the widget will work with any theme not just yours.
I’ll have to look into this (I have just made some CSS modifications=. Do you think that is also the reason for the widget not updating with my files?
Can’t say for sure but maybe.
https://premium.wpmudev.org/blog/create-custom-wordpress-widget/
I don’t have to rewrite the widget I guess…. please tell me if anything is wrong with my current Memphis widget, because that’s the only thing I have changed:
<style> .mdocs-widget-table th {text-align:center;} .mdocs-widget-table tr {border-top:2px dashed #000;} .mdocs-widget-table tr:first-child {border-top:2px dashed #333;} </style> <table class="table table-condensed mdocs-widget-table"> <!--<tr> <?php if(get_option('mdocs-hide-widget-numbers')) { ?><th></th><?php } ?> <th>File</th> <th>Date</th> </tr>--> <?php $item_index = 1; for($i=0; $i< $instance['lu-count']; $i++) { if(!isset($the_list[$i])) break; if($the_list[$i]['file_status'] == 'public') { $permalink = mdocs_get_permalink($the_list[$i]['parent']); echo '<tr>'; if(get_option('mdocs-hide-widget-numbers')) echo '<td>'.($item_index).'.</td>'; echo '<td><a href="'.$permalink.'null" >'.$the_list[$i]['name'].'</a></td>'; //echo '<td class="mdocs-widget-date" ><small>'.date(get_option('mdocs-date-format'), $the_list[$i]['modified']).'</small></td>'; echo '</tr>'; $item_index++; } else $instance['lu-count']++; } ?> </table>I don’t see the variable $the_list being set?
trust me Bhaldie I havent’ touched anything else (except checking the “hide widget numbers” in Options)… I see the_list in the code, but I cannot interpret it because I’m not a developer.
I suggestion downloading a untouched version of mDocs and see if the problem persists.
yes but I think you once told me that uninstalling Mdocs would cause all my files to get deleted. Do you confirm that, or is there a way of saving files/css/settings?
you don’t need to uninstall it, just download mdocs then ftp into your plugins directory and delete the old mdocs folder and replace it with the new download mdocs folder.
unfortunately, overwriting the folder has not changed anything… the h3 is still visible and files list is not updated π
well the h3 issue will not go away as I explained before this is something you will need to fix in your theme.
the file issue is a problem and needs to be addressed, what widget are you using again I forget?
“last updated”
The topic ‘a h3 node casually added in the widget’ is closed to new replies.