Help with a query not working with custom taxonomy

Try something like this: $sotmArticle_query = new WP_Query( array( ‘post_type’ => ‘news’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘postCat’, ‘field’ => ‘slug’, ‘terms’ => ‘sotm’ ) ), ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘posts_per_page’ => 1 ) ); if($sotmArticle_query->have_posts()){ while($sotmArticle_query->have_posts()){ $sotmArticle_query->the_post(); ?>

Permalinks for quote authors

Create a custom taxonomy quoteauthor, activate pretty permalinks, and you get nice URIs automatically. These URIs will not put the author’s name right behind the root, but something like /qa/steve-stevenson/ should be good enough. Here is a sample code as a plugin, you can download it on GitHub <?php # -*- coding: utf-8 -*- /* … Read more

Post slider with custom post type

I don’t have enough rep to comment, but what does your actual query look like? Edit: I haven’t been able to test it, but I think this will work $args = array( ‘post_type’ => ‘slider’, ‘meta_key’ => ‘_thumbnail_id’, // only pull sliders with images ‘tax_query’ => array( array( ‘taxonomy’ => ‘slideshow’, ‘field’ => ‘slug’, ‘terms’ … Read more

drop-down list another query

Just a standard HTML form will do! <form action=”<?php echo home_url(“https://wordpress.stackexchange.com/”); ?>” method=”get”> <p><?php wp_dropdown_categories(‘taxonomy=taxonomy-1&name=taxonomy-1’); ?></p> <p><?php wp_dropdown_categories(‘taxonomy=taxonomy-2&name=taxonomy-2′); ?></p> <p><input type=”submit” value=”Search!” /></p> </form> Just replace taxonomy-1 and taxonomy-2 with the names of your taxonomies. Important If you registered your taxonomy with a custom query_var, you’ll need to match it in the name argument of … Read more

Adding Custom taxonomies to Press This panel

I assume you’re talking about Custom Post Type, not Custom Taxonomy. Right? If yes, add this code on your functions.php file: function press_this_ptype($link) { $post_type=”example”; $link = str_replace(‘post-new.php’, “post-new.php?post_type=$post_type”, $link); $link = str_replace(‘?u=’, ‘&u=’, $link); return $link; } add_filter(‘shortcut_link’, ‘press_this_ptype’, 11); Once you add the correct Post Type, WordPress will detect all taxonomies attached to … Read more

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