Query Custom Post Type based on text input

If what you are trying to do is pre-populate the text input, it looks to me like you need to echo the $zip_code variable you are creating: <input type=”text” name=”zipcode” placeholder=”Zip Code” value=”<?php $zip_code = mo_baptist_get_meta(‘street_zip’); echo $zip_code ?>” /> other than that, I also noticed that the text input was not closed – I … Read more

WP_Query Class custom field parameters

As I understand it, IN, NOT IN, or BETWEEN work essentially like the MySQL operators of the same name. They are just abstracted somewhat. However, it sounds to me like you don’t need to worry about that. Your description makes me think that you are only worried about the meta_key itself and not any particular … Read more

Get posts from current category?

function filter_where_older( $where=”” ) { $date = get_the_time(‘Y-m-d H:i:s’); $where .= ” AND post_date < ‘$date'”; return $where; } function filter_where_newer( $where=”” ) { $date = get_the_time(‘Y-m-d H:i:s’); $where .= ” AND post_date > ‘$date'”; return $where; } $category = get_the_category(); if(!empty($category)) { $cat_id = $category[0]->term_id; add_filter( ‘posts_where’, ‘filter_where_older’ ); // retrieve older posts from … Read more

How to query for a page, get data, then query for child pages of that page

I don’t understand the distinction you are making between ‘sublevel’ query and ‘toplevel’ query, but this is how I pull children for a page. $children = get_children( array( ‘post_parent’ => $servid, ‘post_type’ => ‘page’, ‘post_status’ => ‘publish’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’ )); ?> Or… $page_children = get_pages( array( ‘child_of’ => $post->ID, ‘post_type’ => … Read more

Performance concerns: index.php vs taxonomy-$taxonomy.php

TL;DR Template: Performance not so much, semantics however, use hierarchy! TL;DR Query String: Use provided hooks, never edit directly. The Template File Apart from performance, first look at semantics. If you direct your browser to a taxonomy archive, WordPress will look for the following files (straight from the Codex): taxonomy-{taxonomy}-{term}.php – If the taxonomy were … Read more

View Achive with Category Filter, but Page per post not working

The problem is that you’re stomping the main query by using query_posts(). Don’t do that. Instead, filter the main query via pre_get_posts: function wpse82113_filter_pre_get_posts( $query ) { if ( is_category( 7 ) && $query->is_main_query() ) { $query->set( ‘posts_per_page’, ‘6’ ); } } add_action( ‘pre_get_posts’, ‘wpse82113_filter_pre_get_posts’ );

How can i listing current category and Featured Category post list?

I think you’re asking about your custom secondary loop affecting your main loop, correct? query_posts() alters the main loop. A quick fix would be to call wp_reset_query() after your custom loop to reset the query data: <?php wp_reset_query(); ?> However, it’s more efficient and friendlier to use WP_Query() instead of query_posts() (especially if you’re making … Read more

how can i hide category?

You essentially want to add the following to $args: ‘cat’ => -65 One way to to this is to add the following line after $args = jr_filter_form();: $args[‘cat’]= -65; Note the – will exclude that particular category ID from the results. Reference: WordPress codex – query_posts() (see: “Exclude Categories From Your Home Page”) — Additional … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)