Can I set the post_type query_var as a link is clicked?

You can use pre_get_posts filter hook to set the post type passed by the user: paste this code in your theme’s functions.php file: function user_set_type( $query ) { //only on your taxonomy page if ( $query->is_tax(‘YOUR_CUSTOM_TAXONOMY’) ) { //and only if the guesst has selected a type if (isset($_GET[‘UTYPE’]) && !empty($_GET[‘UTYPE’])){ $query->set( ‘post_type’, $_GET[‘UTYPE’] ); … Read more

Creating an option for writing a post without an author attribution for a group blog on WordPress

This is entirely possible. Though, I would recommend using the Post custom metadata (i.e. custom fields, or better yet, a custom metabox). I would use a custom metabox, with two radio select options: Byline: (*) Author ( ) None Then, in your template file, you can output the author byline only if the appropriate post_meta … Read more

custom post type tag lists and link to post

Try this: global $post; $tmp_post = $post; //First get the list of terms $terms = get_terms(“post_tag”); //then loop over the list and get the posts of each term echo “<ul>”; foreach ( $terms as $term ) { $args = array(‘posts_per_page’ => -1, ‘tag’ => $term->slug, ‘post_type’ => ‘album’); $myposts = get_posts( $args ); if (count($myposts) … Read more

Front End Dropdown Showing All Custom Post Type ‘Agent’

try this: //first get all agents $agents = new WP_Query(array(‘post_type’ => ‘agent’, ‘posts_per_page’ => -1, ‘order’ => ‘ASC’, ‘orderby’ => ‘title’)); //then just print out the dropdown: if ($agents->have_posts()){ echo ‘<select id=”agent”>’; while ($agents->have_posts()){ $agents-the_post(); echo ‘<option value=”‘.get_permalink($post->ID).'”>’.get_the_title($post->ID).'</option>’; } ?> </select> <script type=”text/javascript”> <!– var dropdown = document.getElementById(“agent”); function onCatChange() { if ( dropdown.options[dropdown.selectedIndex].value > … Read more

Insert a Custom Post type into my Loop

To alter your default or main loop you can add query_posts before the loop runs. http://codex.wordpress.org/Function_Reference/query_posts http://codex.wordpress.org/Class_Reference/WP_Query ( parameters) For example in your above code, to include all posts including custom posts types you would write; <?php query_posts( ‘post_type=any’); ?> <?php while (have_posts()) : the_post(); ?> //rest of your code from above If you want … Read more