Custom post-type custom query – show all posts

This code: $term = get_term_by( ‘slug’, get_query_var($wp_query->query_vars[‘taxonomy’]), $wp_query->query_vars[‘taxonomy’]); … just fetches the term data for the currently queried term, it’s not altering the query in any way. To alter the query for your taxonomy term archives, you want to use the pre_get_posts action. Altering the query in the template just creates a new query, overwriting … Read more

Add Permalink to Post Thumbnail, syntax code issues

That is because you haven’t close php before anchor tag <?php $args = array( ‘post_type’ => ‘xyz’, ‘posts_per_page’ => -1, ‘orderby’ => ‘rand’ ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <a href=”https://wordpress.stackexchange.com/questions/66197/<?php the_permalink(); ?>” title=”<?php the_title_attribute(); ?>” > <?php the_post_thumbnail(‘wine-flow’, array(‘class’ => ‘item’)); ?> </a> <?php endwhile; ?>

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

Pagination on a page

in that Archive page, where you have your pagination (did you create it?) use add_query_arg(‘paged’, (int)get_query_var( ‘paged’ )+1); for the ‘next page’ href. Also, WP Page-Navi is a GREAT and easy way to add pagination to your archive-post_type.php file