Filter unique custom field value based on custom taxonomy category or other custom field

The filtering can be done with this function totally untested function filter_custom_fields($key=”, $terms=””, $tax=”, $selkey=”, $selval=””) { global $wpdb; $include=””; if ( $selkey && $selval && ( is_string($selval) || is_array($selval) ) ) { $include = ” AND post_id IN (” . $wpdb->prepare(“SELECT DISTINCT post_id FROM $wpdb->postmeta WHERE meta_key = %s AND meta_value “, $selkey ); … Read more

Change out put of the_post_thumbnail in PHP

Filters are WordPress not PHP. Second, you have called the thumbnail_filter function. You hooked it to post_thumbnail_html so any time a function runs that applies that filter, like the_post_thumbnail, your function runs. If you think about that, you will see that you have a bit of a Loop there. The filter calls a function (twice) … Read more

Call to a member function get_row() on a non-object, Unable to use global $wbdp inside a plugin

In a comment you clarify: what i meant by running is going to the url (mysite.com/wp-content/plugins/myplugin/checkrank.php?id=1) In that case, you are running a standalone file. Yes, one that resides inside WordPress’ plugins folder, but you don’t access it in the context of WordPress (i.e. from within it). Here, none of the WordPress core functions/methods/classes will … Read more

Comment_author_url doing nothing

Change your query from: SELECT COUNT(comment_author_email) AS comments_count, comment_author_email, comment_author, comment_author_url FROM ‘.$wpdb->comments.’ WHERE comment_author_email != “” AND comment_type = “” AND comment_approved = 1 GROUP BY comment_author_email ORDER BY comments_count DESC, comment_author ASC LIMIT ‘.$amount To: SELECT *, COUNT(comment_author_email) AS comments_count, comment_author_email, comment_author, comment_author_url FROM ‘.$wpdb->comments.’ WHERE comment_author_email != “” AND comment_type = “” … Read more

How to set base url for php widget

You are using paths relative to the current directory. Try this (untested) echo “$i. <option value=”” . home_url(“/groundfish-meetings/’ . $file) . “‘>$file</option>”;

Admin Menu new tab external link

That menu is rendered by a function called _wp_menu_output in menu-header.php and I don’t see a hook that will let you alter the HTML for those links, which is what you’d need to do– ie. <a target=”_blank” … That being as it is you will probably need to do this with Javascript either by rewriting … Read more