How go give $value to wp_query

Assuming removeCommonWords() returns a string, you can do the following: $zoekterm = removeCommonWords(‘motorkap met’); $query2 = new WP_Query( array( ‘s’ => $zoekterm ) ); while( $query2->have_posts() ) { $query2->the_post(); echo the_title() . ‘</br> ‘; } Sometimes the array notating is more useful than the string notation …

Adding pagination to sub-wp_query within a singular post page

You need to add a query var and rewrite rule to make that work. First, add the query var to WordPress query vars array in your theme’s functions.php: add_filter( ‘query_vars’, ‘wpa58904_query_vars’ ); function wpa58904_query_vars( $query_vars ){ $query_vars[] = ‘my_page’; return $query_vars; } Then add a rewrite rule with your desired pattern that sets your custom … Read more

the_category() doesn’t working in wp_query loop

the_category() only works for the “Category” taxonomy which doesn’t appear to be hooked to your custom post type. I see you’re registering a custom taxonomy. If you want to show the terms from that taxonomy that are assigned to the post, you’ll need to use the_terms() or get_the_terms(): the_terms( $post->ID, ‘fgaleri’, ”, ‘, ‘, ” … Read more

Attempt to display site authors in a carousel – User Image not Outputting inside li tags

You should be using get_users() – this will perform your query and also allow you to limit by role. http://codex.wordpress.org/Function_Reference/get_users userphoto isn’t a WordPress function, but get_avatar() is: http://codex.wordpress.org/Function_Reference/get_avatar Just check out the Codex examples and you should be able to modify to suit your needs! — UPDATE — I reread and realized maybe userphoto … Read more

Featured images loop for Orbit Slider

I’d use the this code to print the image instead of using the_post_thumbnail();. So that the $slider_query->current_post can be used to print the current iteration of post in WP_Query loop. Eg. <img src=”https://wordpress.stackexchange.com/questions/61017/<?php wp_get_attachment_url( get_post_thumbnail_id() ); ?>” alt=”the-alt-tag” data-caption=”#htmlCaption-<?php $slider_query->current_post; ?>” /> Update – Untested but it should work. Make sure you turn on WordPress … Read more

meta_query returning excluded result

i’m not sure about this one, but i think you have too many nested arrays. you should be getting something like [meta_query] => Array ( [relation] => OR [0] => Array ( [key] => _cmb_tuesday_location_1 [value] => huntley [compare] => LIKE ) [1] => Array ( [key] => _cmb_tuesday_location_2 [value] => huntley [compare] => LIKE … Read more

get latest added term from taxonomy and insert into php variable

The latest term means it’ll have the highest term_ID right, So we’re sorting terms in DESC order and getting first array element of the result in $latest_mailer variable. Here’s code to do that, not tested but if didn’t worked – you can modify get_terms() function to return term with higest id. $mailer = get_terms(‘mailers’,’orderby=id&order=DESC&number=1′); $latest_mailer … Read more