Limit Tags display and ad Drop Down Menu

This can be a start… <?php $tags = wp_get_post_tags($post_id); $html=”<div class=”post_tags”>”; $i=1; foreach ( $tags as $tag ) { $tag_link = get_tag_link( $tag->term_id ); if($i>3) { if($i==4) { $html .= ‘<ul class=”post_tags_menu”>’; } $html .= “<li><a href=”https://wordpress.stackexchange.com/questions/88264/{$tag_link}” title=”{$tag->name} Tag” class=”{$tag->slug}”>”; $html .= “{$tag->name}</a><li>”; } else { $html .= “<a href=”https://wordpress.stackexchange.com/questions/88264/{$tag_link}” title=”{$tag->name} Tag” class=”{$tag->slug}”>”; $html .= … Read more

problem in query_vars parameters

As best as I can understand, you are looking to echo out the value of a query variable. The WordPress function for getting a query variable is get_query_var(). So in your videolar.php template you would add: echo get_query_var(‘tur’);

Avoiding page loop

I would highly recommend you to make one of those wp query calls the main query & all others as secondary queries. That will make your life much easier in the long run. If you absolutely want to disable the main query, wordpress doesn’t have a direct filter for that. You can however do a … Read more

Modify query after meta value

Here’s an example using WP_Query‘s meta_query to query posts between two meta key values: $meta_query = array( array( ‘key’ => ‘event_date’, ‘value’ => array( $date_start, $date_end ), ‘compare’ => ‘BETWEEN’ ) ); $args = array( ‘posts_per_page’ => -1, ‘meta_key’ => ‘event_date’, ‘orderby’ => ‘meta_value’, ‘meta_query’ => $meta_query ); $results = new WP_Query( $args );

Query specific number of posts for each post type in specific order

You can use WP_Query() with paged array key to pass the current page number: <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args = array( ‘post_type’ => ‘articles’, ‘posts_per_page’ => 4, ‘paged’ => $paged ); $articles = new WP_Query($args); //////////////////////////////// $args = array( ‘post_type’ => ‘news’, ‘posts_per_page’ => 1, ‘meta_query’ => array( array( ‘key’ => … Read more

Custom search: Search posts but display parent page in results

Ok I have figured it out; added the following to functions.php: add_filter( ‘posts_request’, ‘my_request_filter’, 10, 2 ); function my_request_filter($sql, $query) { if($query->is_main_query() && is_search()) { $sql = “SELECT * FROM wp_posts WHERE post_content LIKE ‘[smoothslider%’ AND post_parent !=’0′”; } return $sql; } I understand that with no access to the database or being able to … Read more