WP-PageNavi gives me a 404 when using WP Query

This could be a plugin compatibility problem. Have you tried to disable all plugins and see if that solves the problem? I found this which may also be of help: http://dre.im/if-pages-return-a-404-after-wordpress-3-1-upgrade/ Log in to wp-admin and go to permalinks, click save (this should refresh your permalinks). Check to see if this fixes your permalinks. If … Read more

If orderby parameter using pre_get_posts is the same for multiple posts what fallback does the query use?

For identical values they’ll be in whatever order they’re returned by the database engine, which would typically be the order they were inserted in the database. Anyway, the question you’ve linked is old, you can order by multiple columns with WP_Query: $query->set( ‘orderby’, array( ‘menu_order’ => ‘ASC’, ‘date’ => ‘ASC’ ) ); pre_get_posts acts on … Read more

get_posts() seemingly ignoring post_type

I built a workaround for now, but would really love to know what is causing this. The workaround was obtained by removing changing “suppress_filters” to true and then adding a function that adds to the where clause of the SQL… But I would rather know how to fix this at the root rather than a … Read more

WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)

Nevermind I (think) I got it… $args = array( ‘post_type’ => ‘product’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘product_cat’, ‘field’ => ‘slug’, ‘terms’ => array( ‘ring’ ), ), array( ‘taxonomy’ => ‘product_tag’, ‘field’ => ‘slug’, ‘terms’ => array( ‘black’, ‘men’ ), ‘operator’ => ‘AND’ ), ), ); Missing the ‘operator’ => ‘AND’ … Read more

Transient pagination not working properly

Short answer: You are making the same query no matter what page you are, but you’re expecting a different result. Long answer: The query should be different for second page, having paged=2, so your query (and transients) with pagination should look like this: $paged_var = get_query_var( ‘paged’ ) ? get_query_var( ‘paged’ ) : 1; if … Read more

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