Paginated Archives or Loop by Month

I think this is not very hard to do. If you have currently have paginated date-based archives you can just disable paging when you are in a month overview: add_action( ‘pre_get_posts’, ‘wpse12983_pre_get_posts’ ); function wpse12983_pre_get_posts( &$wp_query ) { if ( $wp_query->is_month() ) { $wp_query->set( ‘nopaging’, true ); } } You can use get_month_link() to get … Read more

Should I escape the attributes when using get_month_link?

Yes, escaping everything (and as close to output as possible) is a way to go. Right until the point excessive escaping is causing issues in specific circumstances. Note that while this happens in context of attribute, esc_url() is more fitting for URLs. Always use esc_url when sanitizing URLs (in text nodes, attribute nodes or anywhere … Read more

Displaying time & date problem

Two ways at least: Method 1 If you happy to accept the latest of all the wp posts ‘last modified’ as the date that the site was last updated, then you could add a function to get the latest of the ‘post_modified’ in the posts table and add that to your header.php either in the … Read more

Copyright: Get first and last date of post type

There was an issue with the code originally posted by kaiser in that it queried for year, month and day distinctly resulting in values representing “the largest month for any date” or the “smallest day for any date” rather than values representing the MAX and MIN dates globally. I altered that original code to query … Read more

Time Based change of image

I believe you’re using the wrong function. get_the_time() doesn’t actually return the current time but instead the time of when the post was published. Maybe what you’re looking to use is date( ‘H’ ).

Show the_date with link

Try this: <?php $archive_year = get_the_time(‘Y’); $archive_month = get_the_time(‘m’); $archive_day = get_the_time(‘d’); ?> <a href=”https://wordpress.stackexchange.com/questions/201844/<?php echo get_day_link( $archive_year, $archive_month, $archive_day); ?>”><?php the_date(‘Y/m/d’); ?></a> HTML result: <a href=”http://example.com/2015/09/07″>2015/09/07</a>

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