Tag Info

Hot answers tagged

4

Looking at the source code that WordPress uses to register widgets here, there's a $number parameter defined, in line 242, as: The unique order number of this widget instance compared to other instances of the same class. The function _set($number) stores this ID number attached to the base identifier string of the widget. Then, the function ...


2

I hate answering my own question, but hopefully this can help someone else with similar issues: Wordpress uses Iris color picker. http://automattic.github.io/Iris/# Wordpress also creates a jquery widget with default settings for Iris. The file can be found under wp-admin/js/color-picker.js At first I was trying to pass values directly to iris(), which ...


2

I have no idea why this should solve the issue but I can solve it. Use a different file name. For example: include('my_widgets.php'); I get the error you describe with include('widgets.php'); but not with a different file name. I don't know why. I do know that WordPress has a Core file named widgets.php but I can't work out why there should be a conflict. ...


2

You don't need to worry to much about your query as there is not much you can do about it. You can unfortunately not just only query categies, post titles and images natively using WP_Query. Post categories needs to be called separately inside the loop, just like featured images. If you dig deeper into core, you will see that all postdata and post terms are ...


1

I always move my filters inside my query, this will inhibit them from showing anything when my query returns no results. You just need to move the following echo $args[ 'before_widget' ]; if ( !empty( $title ) ) echo $args['before_title'] . $title . $args['after_title']; to just after this line if ( $related_posts ) { ?> EDIT I have ...



Only top voted, non community-wiki answers of a minimum length are eligible