How do I group results from wp-query

Need to track the previous job title, and if it’s different, insert your line break. Untested: $prev_job_title = null; while ( $staff->have_posts() ) { $staff->the_post(); $job_title = get_post_meta( get_the_ID(), ‘job_title’, true ); if ( $prev_job_title !== $job_title ) { printf( ‘<h2>%s</h2>’, esc_html( $job_title ) ); $prev_job_title = $job_title; } // Staff markup. }

How to group posts by months and add pagination?

Try this code <?php $catnam = ‘1’; $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; // the total of registers to show on each page $showp = 4; wp_get_archives(“type=monthly&showposts=$showp&paged=$paged”); while (have_posts() ) : the_post();?> <h4><a href=”https://wordpress.stackexchange.com/questions/131770/<?php echo get_permalink(); ?>”><?php the_title();?></a></h4> <?php endwhile;?> <?php global $wp_rewrite; $paginate_base = get_pagenum_link(1); if (strpos($paginate_base, ‘?’) || ! $wp_rewrite->using_permalinks()) { $paginate_format=””; … Read more

Allow members to create groups on my site

You can use BuddyPress to create groups, manage groups, allow users to join groups and search them. BuddyPress is like a Social Network plugin for WordPress. Has it’s own sub-section/ecosystem of plugins and add-ons and code snippets that you can apply. https://en-ca.wordpress.org/plugins/buddypress/ There’s an active developer community and lots of documentation too: https://codex.buddypress.org

tech