Not getting metavalue

The mysql_*() functions won’t work after WP 3.9, so don’t use them. See Make WordPress Core entry MySQL in WordPress 3.9. It is adviced to use $wpdb methods instead – if necessary. In your case – as far as I can tell – it isn’t necessary at all. You can use the relevant API functions … Read more

WP_Query custom query showing only 10 posts on all pages

One of two things is happening that I can think of: You have sticky posts showing up. Try adding an ignore_stickie_posts argument. $args = array ( ‘pagination’ => true, ‘posts_per_page’ => 5, ‘ignore_stickie_posts’ => true, ); See: https://wordpress.stackexchange.com/a/85658/21376 You have a poorly written (too global) pre_get_posts filter. Something like: function naughty_pre_get_posts( $query ) { $query->set( … Read more

Multiple loops without repeating content

As explained in Codex post__not_in (array) – use post ids. Specify post NOT to retrieve. post__not_in argument have to be passed as array. Change your query to: $the_query = new WP_Query( array( ‘category__in’ => $project_category, ‘posts_per_page’ => -1, ‘post__not_in’ => array( $postid ), ) ); And it should work.

paging in WP_Query on static page

i have edited your code a bit. And i think it should work.You need to pass parameters to previous_posts_link and next_posts_link. So try the following code <section id=”blogposts” class=”content-block content-3-5 blogposts”> <div class=”row”> <!– Feature Box 1 –> <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $blogposts_args = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, … Read more

From where is archive.php getting its posts?

The main query is set up by WP class (curiously little known, since there is rarely reason to mess with it). It happens in between WP core finishing load and proceeding to load template, in wp-blog-header.php. Note that some nuances of implementation: WP class works on a global, set up earlier in wp-settings.php the global … Read more

How to Filter Posts by Custom Fields?

Since you have not provided any code, below code snippet assumes a ‘property’ as post type and price as meta field. I think the code will provide you some direction and you can take it from there. Feel free to make changes as needed: $args = array(‘post_type’ => ‘property’, ‘meta_key’ => ‘price’, ‘orderby’ => ‘meta_value’, … Read more

Search for multiple tags?

Well, I got it working by making my own own parse php as follows: parse.php <?php $tags = $_POST[‘tag’]; $search = $_POST[‘s’]; $count = count($tags); $i = 0; if(!empty($search)) $uri = “https://example.com/?s=$search&”; else $uri = “https://example.com/?tag=”; foreach($tags as $name=>$value) { ++$i; if($i !== $count) $uri .= $value.”+”; else $uri .= $value; } header(“Location: $uri”); exit; … Read more