How to show monthly archive posts?

Create a file date.php in your active theme and use below code, you may need to polish this code as per your requirement: <div id=”content” class=”post-archive<?php echo $content_class; ?>”> <?php if ( have_posts() ) : ?> <header class=”archive-header”> <h3 class=”archive-title”> <?php if ( is_day() ) : ?> <?php printf( __( ‘Daily Archives: %s’ ), ‘<span>’ … Read more

List archive year – post by post

Here is a strip down of something similar I’ve done a while ago. Here is what the code basically does is: First, it retrieves the date of the first post on the block. Secondly, the current date is retrieved. These two values are fed into a range() function to get all years in between A … Read more

Custom archives page by month and year – nesting problem

After much more work, I developed a solution that outputs archives by year, month and day while minimising database calls. Posting it here for others to use: //* Add custom archives below entry content add_action( ‘genesis_entry_content’, ‘custom_archives_page_content’ ); function custom_archives_page_content() { global $post; // set post arguments $args = array( ‘posts_per_page’ => -1, ‘orderby’ => … Read more

All post of child category not in top category

Maybe something like this would do? $cat=”About us”; $tax = ‘category’; $cat_id = get_cat_ID($cat); $category = get_term_children($cat_id, $tax); $pre=””; foreach ($category as $sub) { $cat_list .= $pre . $sub; $pre=”, “; } query_posts(array( ‘cat’ => $cat_list, ‘posts_per_page’ => 1000)); echo ‘<ul>’; while ( have_posts() ) : the_post(); echo ‘<li>’; the_title(); echo ‘</li>’; endwhile; echo ‘</ul>’;

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