Stuck in the query loop

<div class=”pr_grid_cell clearfix”> <?php //for each category, show posts $categories=get_categories(); foreach($categories as $cat) { $args=array( ‘post_type’ => ‘products’, ‘showposts’ => -1, ‘category__in’ => array($cat->term_id) ); $posts = new wp_query($args); // This is the best way to if ($posts->have_posts()) while ($posts->have_posts()) { //condional if/while 2-in-1. If you dont check have_posts, you’ll get an ugly error when … Read more

How to group posts and get a mixed posts and groups view?

A custom taxonomy makes perfect sense – here’s hoping I haven’t missed something: $songs = get_posts( array( ‘post_type’ => ‘song’, ) ); $index = array(); // Build an album_id => songs index foreach ( $songs as $song ) { if ( $albums = get_the_terms( $song->ID, ‘album’ ) ) $index[ $albums[0]->term_id ][] = $song; else $index[ … Read more

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