Custom random quote widget breaks when used in multiple sidebars

No parent necessary: the difference between a not-working widget and a working widget was this: $text1 = apply_filters( ‘widget_text1’, $instance[‘text1’], $instance ); vs: $text1 = apply_filters( ‘widget_text1’, empty($instance[‘text1’]) ? ” : $instance[‘text1’], $instance, $this->id_base); I realized putting multiple Random Text widgets on the same page, their titles worked, but their text content did not. So … Read more

custom rss templete

you can create your own custom rss template and create thr loop inside it so you will have easy access to loop only function take a look at this answer that shows how to create your custom rss How to create additional full text RSS feeds

Using $themename Variables

You can do it easier and without polluting the global namespace: get_option(‘template’); gives you the (parent) themes name. If you want the child themes name, use get_current_theme();. You could also use a constant across your theme files: define( ‘YOUR_PREFIX-THEME_NAME’, get_current_theme() );

How to validate this deprecated function

First of all, it’s not the add_filter() call that you’re supposed to be modifying, but the callback: ‘filter_user_has_cap’, i.e. go to where that method is defined and change the user level to ‘edit_pages’. Fixing deprecated notices is easier with the Log Deprecated Notices plugin.

Linking text within textarea of custom meta box

I finally found the answer to this and am posting it here in case someone else needs the answer. Just put the following in your theme file. <?php global $post; $variable_name = get_post_meta($post->ID, ‘custom_metaBox’, true); echo html_entity_decode( $variable_name ); ?> Change the variable name and custom_metaBox to your specific values and voila, functioning HTML code.

Pass variable to hook. Its possible?

Ok i can pass variables to hook but i was doing it wrong. Code should be: function encrypt_password_function($pass, $id){ global $wpdb; $encrypted=sha1($pass); $wpdb->query($wpdb->prepare(“UPDATE wp_users SET iphone_pass = %s WHERE ID = %d”,array($encrypted, ’10’))); } function encrypt_password($var1, $var2) { do_action(‘encrypt_password’,$var1, $var2); } add_action(‘encrypt_password’, ‘encrypt_password_function’, 1,2);

Featured Image Thumbnail Creation

The image isn’t created on save, but rather on upload. The same process that creates the “thumbnail”, “medium”, and “large” size images also creates any other image sizes defined via add_image_size().

Query posts from category based on a filter most favorited

query_posts accepts custom query variable as arguments. So assuming that adding ?sort_by=most_favourites to an url alters the sort order to sort by the most favourites (i.e. you’ve set sort_by as a recognised WordPress query variable, and setting it sorts the returned posts accordingly) then, try: $args = array( ‘cat’ => $cat_lists[$i], ‘showposts’ => intval(get_theme_option_by(‘bn_list_per_item’, 6 … Read more