Get posts after today (upcoming events)

Hi @user2816: It would seem you are using that code in more than one widget? Try changing part of that code from these: function filter_whene($whene=””) { $whene .= ” AND post_date >= ‘” . date(‘Y-m-d’) . “‘ “; return $whene; } add_filter(‘posts_whene’, ‘filter_whene’); To this: if (!function_exists(‘filter_whene’)) { function filter_whene($whene=””) { $whene .= ” AND … Read more

How to list all custom post types in a custom widget?

Figured out how (Thanks to WordPress Codex): /** @see WP_Widget::widget */ function widget($args, $instance) { extract( $args ); $title = apply_filters(‘widget_title’, $instance[‘title’]); ?> <?php echo $before_widget; ?> <?php if ( $title ) echo $before_title . $title . $after_title; ?> <?php // Create and run custom loop $custom_posts = new WP_Query(); $custom_posts->query(‘post_type=page_content’); while ($custom_posts->have_posts()) : $custom_posts->the_post(); … Read more

Adding a Widget : what to put in plugin URL

When adding a plugin to WordPress.org plugin repository you need to host the plugin somewhere (anywhere) and that is the “Plugin URL” so the good guys at WordPress could download it, test it and approve it to be listed. so just upload it to your host and enter the url to the zip file. Once … Read more

A form in a custom widget

I remember a support topic i read with regard to a problem when you use the name name for one of your post fields, try prefixing your input names. <input type=”text” name=”my-name” … And see if that helps.. Follow-up #1 I performed a simple test inside a widget.. if( isset( $_POST ) ) { print'<pre>’;print_r( … Read more

how to put functions inside of widgets

there are a few way to run a function in widgets: option 1 – ShortCodes You can create a custom shortcode and run that function by entering the shortcode into a simple text widget: //this is to make sure WordPress renders the shortcodes in a text widget add_filter(‘widget_text’, ‘do_shortcode’); add_shortcode(‘my_short_code’,’my_function’); function my_function(){ //do whatever you … Read more

widget dropdown menu code

The format of the selected() function you are using is incorrect. selected() can only be passed two variables, you are passing three. Please see this codex article for help: http://codex.wordpress.org/Function_Reference/selected Without you pasting more of your code I cannot see how to fix your above code.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)