Custom query does not find pages

This is not the place to use query_posts. query_posts should only be used if you need to change the main loop. There is also no need to reset the query and your missing endif on both loops. I would use get_pages instead of running a new WP_Query. $pages = get_pages(); foreach ( $pages as $page … Read more

wpquery via ajax

The accepted answer on this post: Ajax and autocomplete does an extremely good job of showing exactly how to integrate an ajax call within WordPress.

WP_Query with 2 genres

Something along these lines should work: $myposts = new WP_Query( array( ‘post_type’ => ‘widgets’, ‘post__not_in’ => array($wp_query->post->ID), ‘tax_query’ => array( array( ‘taxonomy’ => ‘genre’, ‘field’ => ‘slug’, ‘terms’ => array( ‘styleA’, ‘styleB’ ) ) ) ) ); I’m not sure if you need to add ‘relation’ => ‘OR’, after line 4, so try it with/without … Read more

how to translate countries output from wp database?

you need to have the actual translations somewhere in a .mo file. for your plugin / theme. 1) when you setup the codes, you can also “mark them for translation” http://codex.wordpress.org/I18n_for_WordPress_Developers#Marking_Strings_for_Translation 2) create the translations for the languages somehow – various tools. eg this one: http://wordpress.org/extend/plugins/codestyling-localization/ 3) in your plugin must tell wp to load … Read more

Query not sorting DESC

if you want to order it DESC put DESC in your query. $postslist = new WP_Query(‘meta_key=Ordermetakey&orderby=meta_value_num&order=DESC&posts_per_page=5’);