How do I override the default number of items to be listed on an archive.php page? [duplicate]

You can hook into pre_get_posts and modify the query. Your hooked function will receive a WP_Query object as it’s only argument. You can check to see if you’re on a the correct post type archive and modify away. Something like this: <?php add_action(‘pre_get_posts’, ‘wpse63675_pre_posts’); function wpse63675_pre_posts($q) { if(!is_post_type_archive(‘your_album_type’)) return; $q->set(‘posts_per_page’, 20); // or however many … Read more

Ascending order of yearly archives [closed]

You will have to define post order in second SQL query too. Try this one. // get years that have posts $years = $wpdb->get_results( “SELECT YEAR(post_date) AS year FROM wp_posts WHERE post_type=”post” AND post_status=”publish” GROUP BY year DESC” ); foreach ( $years as $year ) { // get posts for each year $posts_this_year = $wpdb->get_results( … Read more

Highlight archive link on single.php

As your links are generated by get_archives_link(), this is the place where you have to look. Doing so, by inspecting the source , you will notice that get_archives_link() – itself – doesn’t give you the possibility to add a CSS class to make the highlighting happen. There is of course the filter hook get_archives_link – … Read more

Can’t replace the default sidebar with a custom sidebar on Custom Post Type in Genesis

I have this post and the response from David Chu to thank for enlightening me. There is nothing patently ‘wrong’ with the way that I implemented this. The reason that it doesn’t work is because of the fact that I have both the Genesis Simple Sidebars plugin and the Genesis Woocommerce Connect plugin installed. Both … Read more

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