Tagged: widgets
- This topic has 23 replies, 5 voices, and was last updated 6 years, 6 months ago by
Steve.
-
AuthorPosts
-
-
August 8, 2013 at 10:20 am #968
atomworksMemberHi,
Posted a widget related question yesterday but not 100% sure it posted or is waiting authorisation, either way, having a different issue.
I can’t see the widgets in the front-end at all using either custom or demo widgets (stock widgets work as normal), I’m using the latest beta. Any ideas?
-
August 8, 2013 at 12:28 pm #970
MarcusMemberHaving the same problem here.
-
August 8, 2013 at 1:36 pm #975
atomworksMemberBring up the debug messages I seem to get this if it’s any clue:
Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method PikList_WordPress::get_meta_sql() should not be called statically in /Applications/MAMP/htdocs/dev_sda/wp-includes/plugin.php on line 230 -
August 8, 2013 at 1:43 pm #976
atomworksMemberI’m not sure if this is related to the actual issue. If I change public function get_meta_sql() to public static function get_meta_sql(), and do likewise for the errors that appear in the header too, I can get rid of all the errors but I still get nothing appearing in the widgets area.
-
August 14, 2013 at 6:12 am #991
atomworksMemberIs there any official word on this, or any ideas what might be causing the problem. I’ve gone round the code and am having trouble identifying what might be the issue. If you guys have an idea I’m happy to keep digging about but at the moment I can’t warrant spending the time on it which is a shame as I’d much rather have this working then make widgets the old fashioned way!
EDIT: Most I’ve managed to get worked out is that the widget() function in class-piklist-widget.php, which I assume is meant to be what WordPress uses to output widgets doesn’t seem to be called. I’ve dropped in an echo to see if I can get something to happen and that doesn’t work.
-
August 14, 2013 at 1:16 pm #995
atomworksMemberOK, I’ve had a dig about and found part of the problem and enough to smooth over it. It doesn’t however fix the cause of the issue, just the symptoms.
The symptom (cause unknown):
class-piklist-universal-widget.php
Line 86:
piklist::render(piklist::$paths[$options[1]] . '/parts/widgets/' . $options[2], array( 'instance' => $instance ,'settings' => $instance // NOTE: So beginners have a more understandable name to store variables from the widget ,'before_widget' => $before_widget ,'after_widget' => $after_widget ,'before_title' => $before_title ,'after_title' => $after_title ));This first argument is the one that tells the renderer what template file to use, and this is what is causing the problem, $options[2] most specifically. It should contain the file name (without the extension), but it also has some extra characters crammed in so where it should be ‘example’ it is actually ‘example”;’ ( notice the extra “; )
This happens on both the demo widgets and custom widgets so I don’t believe I’m doing anything wrong in implementation. It looks like this is being pulled from part of the serialised array that’s in the database and overshooting the end of the value. Here is a sample value I had in my database from a widget attempt.
a:2:{i:2;a:4:{s:30:"piklist_universal_widget_theme";s:68:"a:1:{i:0;s:50:"piklist_universal_widget_theme--theme--image-block";}";s:9:"demo_text";s:30:"a:1:{i:0;s:12:"Default text";}";s:11:"demo_select";s:24:"a:1:{i:0;s:7:"option1";}";s:16:"demo_colorpicker";s:24:"a:1:{i:0;s:7:"#aee029";}";}s:12:"_multiwidget";i:1;}So, not sure what’s causing it and I’ve spent more time then I really should have to try and sort this – but it’s for a good cause 😉
The (temporary) fix:
Before the function mentioned above on line 86, insert the following… this simply trims off those troublesome characters.
// Quick Fix: Widget Rendering Problem $options[2] = substr($options[2], 0, -3);Then, with any luck you should be back in business. Hopefully the Piklist team can spot what I’ve said and instantly know what’s going on and where it should really be fixed.
-
August 15, 2013 at 8:53 am #996
SteveKeymasterThanks for the help. Unfortunately we won’t be able to look at this until next week.
-
August 15, 2013 at 9:54 am #999
atomworksMemberNo worries, I’m back up and running where I need to be with my quick fix. Just hope my findings help you guys out!
-
August 15, 2013 at 12:34 pm #1000
MarcusMemberSince you are looking at it next week, could you please see about giving it the option to become its own widget (instead of being a drop down selection in the piklist widget), or included in the piklist widget. And if you can turn off the piklist widget if necessary.
Thanks
Marcus
-
August 23, 2013 at 1:32 pm #1015
SteveKeymasterWidgets be fixed! Get the latest Beta. Released today >
-
August 29, 2013 at 12:17 pm #1038
-
February 21, 2015 at 2:11 pm #3337
GreggMemberHi Steve
Is there an option to expose all the widgets as opposed to grouping them together per @marcus comment?
– Gregg
-
February 21, 2015 at 3:04 pm #3338
SteveKeymaster@gregg- currently Piklist groups widgets by their plugin or theme. There is no setting to remove this.
I’m curious why you don’t like this. The WordPress widget page is pretty dysfunctional when there are lots of widgets.
-
February 21, 2015 at 3:22 pm #3339
GreggMemberI’m stripping away most of the blog related widgets and leaving the custom built ones in place. It’s a cleaner user experience in my case to simply expose all the custom widgets given that there won’t be too many.
-
August 2, 2015 at 12:13 pm #4101
hozefasmileMemberHi all,
I have tried to make a new widget reading the tutorial provided in piklist documentation. But its Not showing at all in wp-admin widget.
If I copy the same files in a piklist plugin created its works as expected, but when I copy that same widget in a theme piklist folder, it not work. (my-theme-folder/piklist/parts/widgets)
Do you have any idea why its not working there? I want to include widget as part of the theme not want to use an additional plugin to handle it.
Thanks
Hozefa -
August 2, 2015 at 12:18 pm #4102
MarcusMemberI’ve had similar problems in the past. Could you please post the header for the widget box?
Just the meta code at the top where you instantiate the widget.Thanks
Marcus
-
August 3, 2015 at 12:26 am #4103
hozefasmileMemberHi Marcus,
Thanks for your reply. I have created two files in the directory my-theme-folder/piklist/parts/widgets/
1. example.php<?php /* Title: Example */ ?> <?php echo $before_widget; ?> <?php echo $before_title; ?> <?php echo $after_title; ?> <?php piklist::pre($settings); ?> <?php echo $after_widget; ?>2. example-form.php
<?php piklist('field', array( 'type' => 'text' ,'field' => 'post_content' ,'label' => __('Example Field') ,'description' => __('Field Description') ,'attributes' => array( 'class' => 'text' ) )); ?>I am using this same code in my custom plugin also. This same code works there but not here if I put it in theme.I am missing something that additionally needed to add to work for theme ?
Thanks
Hozefa -
August 3, 2015 at 1:43 am #4104
MarcusMemberYeah, that should work. You’ve got the two pieces you need. widgetname.php and widgetname-form.php
Have you checked to see that in no other plugin directories you have a duplicate?
If in your theme you have piklist/parts/widgets/example.php and in one of your plugin folders you have /parts/widgets/example.php this will cause problems.Or try and give your -form file a header. Such as:
<?php
/*
Width: 500
*/
?>Just trying some ideas.
Marcus
-
August 3, 2015 at 6:10 am #4105
hozefasmileMemberHi Marcus,
I have removed the plugin widget files. Now there is only these widget files in my theme’s directory. I have also added the comment
/* Width: 500 */as you have mentioned in the example-form.php file, but no luck. It still not showing. But whenever I add these in plugin directory its working. Is there something the theme also need additionally to your piklist files? For example I might need to add some code in functions.php file of the theme to make it work?
Thanks
Hozefa -
August 3, 2015 at 10:10 am #4112
SteveKeymaster@hozefasmile– A /piklist/ folder inside themes is currently not working correctly in the current version of Piklist. If you make a plugin it will work fine.
We are putting the finishing touches on the next version of Piklist which will support themes and child themes.
-
August 3, 2015 at 10:39 am #4113
hozefasmileMemberHi Steve,
Thanks for this update. I hope when it get updated you will also update this post with reply. So that anybody coming to this post will get updated on its status.
Thanks, this plugin is really doing a revolutionary thing for wordpress programming 🙂
Hozefa Saleh
-
August 3, 2015 at 10:47 am #4116
SteveKeymasterThe next major version of Piklist that is released to WordPress.org will have this feature. So, you will just have to upgrade for it to work.
We’re so happy you love Piklist. Would you mind leaving a quick 5 Star review on WordPress.org? It really goes a long way to helping the project.
-
August 3, 2015 at 11:46 am #4119
hozefasmileMemberSure,
I have ranked your plugin with 5 star on wordpress. You deserve it. Best wishes for making this plugin more valuable and powerful!
-
August 3, 2015 at 11:50 am #4120
SteveKeymasterThanks so much!
-
-
AuthorPosts
- The topic ‘Widgets not showing’ is closed to new replies.