Placement of categories

While you may not be able to integrate your categories list directly into the slider (this is dependent on how the slider is set up and I haven’t used this particular theme), it’s possible to display a list of categories and their links that functions in the way you’ve asked and then apply the same … Read more

filter on the_content stopped working when I updated to WP 3.6.1

It appears to be an issue with your RegEx pattern matching images. I modified $pattern to the following and it worked on a test page I setup. $pattern = ‘/<img(.*?)src=”https://wordpress.stackexchange.com/questions/114747/(.*?).(bmp”gif|jpeg|jpg|png)”(.*?)width=”(.*?)” height=”(.*?)” \/>/i’; There were some extra spaces which were throwing it off. I suggest using a RegEx tester to help you make sure your pattern … Read more

woocommerce download post-types\writepanels limits?

It is possible to intercept the get_post_meta(‘_download_limit’) and set a fixed value to it. When trying to save a different value it goes back to the fixed value: add_filter( ‘get_post_metadata’, function( $value, $object_id, $meta_key, $single ) { if( ‘_download_limit’ == $meta_key ) $value = 100; return $value; }, 10, 4 ); See Where to put … Read more

How to use WP_rewrite?

WordPress generates its .htaccess rules by WP_Rewrite->mod_rewrite_rules() method. It passes output through the mod_rewrite_rules filter, which allows you to edit it. To make the new rules be written you will also need to call “hard” reset with flush_rewrite_rules( true ) call.

Archive by Year

The Simple Yearly Archive Plugin does just that. This code will also do the trick: <?php // 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 = … Read more