0
votes
0answers
178 views

Check if values exists DB

I am getting nutts with this one. I want to check if the email introduced in the form already exists in the database before creating a new record. But for some reason the email is empty at search ...
0
votes
1answer
23 views

Connecting to a 2nd DB gives me no results when querying

I'm trying to access a different DB on the same localhost as my wp db is and I did this like so: functions.php: add_action('init','my_new_db'); function my_new_db(){ $newdb = new wpdb( 'test', ...
1
vote
1answer
113 views

example of build_query function?

I have this resource: (http://codex.wordpress.org/Function_Reference/build_query), but it does not give full example. I have this URL: mypage/?page_id=87 and this array: array('name' => 'me') ...
0
votes
1answer
1k views

wp_get_post_terms Order by not working

wp_get_post_terms Order by not working My code is here query_posts(array('post_type' => 'product','post__in' => $product_ids,)); while (have_posts()) : the_post(); global $post; $args = ...
1
vote
3answers
341 views

Delete post revisions on post publish

Is it possible to delete post/page revisions from the database when a post/page is published? 11/05/12 Answer: See the plugin below by bueltge I want to do this on a site with 5,000 posts and ...
1
vote
0answers
67 views

register_taxonomy() take much queries

Sorry for my poor English, I'm russian. I have a problem by adding a lot of taxonomies. When I added about 80 taxonomies, I get the following results(without caching): before: 44 queries 0.352 ...
0
votes
1answer
58 views

Sorting date results from a query

I have a site I run which shows the weddings and anniversaries of some friends. I have this running to show the users (and their anniversaries) according to what month it is: $args = array( ...
0
votes
1answer
119 views

Code in custom widget queries all posts, when it should only query the current post

I have a query in a custom widget (my first one!) which, if it's of custom post type book, retrieves the post ID. This then gets used in a WP_QUERY to retrieve data about the page. This works ...
1
vote
1answer
147 views

Help with Wordpress Query

I'm sort of a noob when it comes to Wordpess; I've only recently started building themes and I've run into a wall. I'm trying to feature 3 different articles at the top of my site using wpquery and ...
7
votes
3answers
615 views

Order posts (across the whole site) by metadata date

My custom 'Home' page is set to sort my custom posts via the custom date field with this (updated to be custom named) code in functions.php: // sort order for home page add_action('wp', ...
1
vote
3answers
1k views

only show container with next/prev links if they exist?

hey guys, i know there is something like if ( function_exists('') is it possible to use that with next_posts_link() and previous_posts_link(). The reason I'm asking that is that I have something ...
0
votes
1answer
540 views

SQL error with custom query

I'm trying to create a custom post query for sorting posts that have been voted "thumbs up". I'm joining my custom "wp_post_votes" table (which stores the number of votes each post received) with ...