Is there any difference between below WP_Query code snippets?

There is no difference in terms of the “final” query. The former was the “old” way of querying post meta, before WP_Meta_Query was introduced with support for more complex queries. WP_Query::get_posts() now simply translates meta_key/value arguments into the new format with WP_Meta_Query::parse_query_vars(). Use whichever format you feel suits best for the task.

Hiding all posts/products/pages from a site based on a custom taxonomy/domain name

From the Codex for pre_get_posts: pre_get_posts cannot be used to alter the query for Page requests (page templates) because ‘is_page’, ‘is_singular’, ‘pagename’ and other properties (depending if pretty permalinks are used) are already set by the parse_query() method. See: Query Overview. The recommended way to alter the main query for page requests is to use … Read more

Custom query on custom table fails

On volume pass single quote in parameter. Now your query is SELECT * FROM cp WHERE year=”1911″ AND quarter=”4″ AND volume=”2a” AND page <= ‘1475’ ORDER BY page DESC LIMIT 1 Try this code

Using orderby with 2 meta keys

One of the options would be to sort at a database level by a dynamically calculated column. This is too complex for me. Having your task on production I would probably create a third meta key: ‘division’ derivated from the two and update its value on every post save. Then I would sort by this … Read more