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

Genesis filterable portfolio isotope [closed]

The archive or taxonomy code: add_filter( ‘genesis_pre_get_option_site_layout’, ‘__genesis_return_full_width_content’ ); wp_enqueue_script(‘isotope’, get_stylesheet_directory_uri() . ‘/js/jquery.isotope.min.js’, array(‘jquery’), ‘1.5.25’, true); wp_enqueue_script(‘isotope_init’, get_stylesheet_directory_uri() . ‘/js/isotope_corsi.js’, array(‘isotope’), ”, true); wp_enqueue_style(‘isotope_css’, get_stylesheet_directory_uri() . ‘/css/isotope_corsi.css’); //* Add custom body class add_filter( ‘body_class’, ‘filerable_portfolio_add_body_class’ ); //* Filterable Portfolio custom body class function filerable_portfolio_add_body_class( $classes ) { $classes[] = ‘filterable-portfolio-page’; return $classes; } remove_action( ‘genesis_loop’, … Read more

Archive for custom taxonomy lists all posts instead of current taxonomy

You have a syntax error in your query. According to the documentation for WP_Query, tax_query is an array of arrays of parameters, which is to say that it should probably look like this: ‘tax_query’ => array( array( ‘taxonomy’ => ‘semester’, ‘field’ => ‘slug’, ‘terms’ => $getterm, ‘include_children’ => true, ‘operator’ => ‘IN’ ), ),

Wp_query Add specific pending posts

Your setup isn’t supported by WP_Query. One approach is to use the posts_where filter of WP_Query (there are other ways possible, like collecting post ID’s instead from different queries.) to adjust the SQL query. To avoid string replaces we could use for example: $custom_query_args = [ ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ]; // Add … Read more

Moving the array pointer inside a WP_Query while loop

$the_query->the_post() is what increments the counter and loads the next post’s data. You can also explicitly set the internal counter to an arbitrary number and begin incrementing from there… $the_query->current_post = 3; $the_query->the_post(); the_title(); // this will output the 4th post’s title

WP Query with custom Shortcode

There are few issue with your code When using WP_Query in conjuction with the_post() or using get_posts() in conjuction with setup_postdata( $post ), you need to reset the $post global with wp_reset_postdata(), not wp_reset_query(). wp_reset_query() is used in conjuction with query_posts() which you should never ever use You would want to reset posdata between your … Read more