Wrap every month posts in div

$last_month = null; while ( $the_query->have_posts() ) : $the_query->the_post(); $the_month = get_the_time( ‘Ym’ ); // e.g. 201611 if ( $last_month !== $the_month ) { if ( $last_month !== null ) { // Close previously opened <div class=”row” /> echo ‘</div>’; } echo ‘<div class=”row”>’; } $last_month = $the_month; ?> <div class=”col-3″> <?php the_title(); ?> </div> … Read more

Displaying posts that belong to a specific author

After setting a taxonomy/post_type you firstly need to flush the rewrite rules. To achieve this you could either run $ wp rewrite flush if you have installed the wp-cli or go to “Settings->Permalinks” and save once. To list a taxonomy in the frontend the url would be example.com/author-team/tom. You could also access the taxonomy url … Read more

Linking to pages/posts within the site

WordPress always uses the full URL when it inserts a link. There are a number of reasons for this, and they are all good reasons. You can add relative URLs yourself by simply typing your own links and omitting the domain portion of the link. So http://sitename.tld/cool-page becomes /cool-page. As I said, though, this is … Read more