Create a hierarchical loop at predefined markup requirements

I was able to figure it out myself, here is the code: <div id=”fullpage”> <?php //for each category, show 5 posts $cat_args=array( ‘orderby’ => ‘name’, ‘order’ => ‘desc’ ); $categories=get_categories($cat_args); foreach($categories as $category) { $args=array( ‘showposts’ => 5, ‘category__in’ => array($category->term_id), ); $posts=get_posts($args); if ($posts) { echo ‘<section class=”vertical-scrolling” data-anchor=”‘ . $category->name.'”>’; foreach($posts as $post) … Read more

Get number of posts in each category since last visit

use wpdb query instead: “SELECT DISTINCT wposts.* FROM $wpdb->posts wposts LEFT JOIN $wpdb->postmeta wpostmeta ON wposts.ID = wpostmeta.post_id LEFT JOIN $wpdb->term_relationships ON (wposts.ID = $wpdb->term_relationships.object_id) LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) WHERE post_date >= {$lastvisit} AND $wpdb->term_taxonomy.taxonomy = ‘category’ “; I did not test this but should work. I also suggest you to use … Read more

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