How to put posts with some taxonomy on top of others in `pre_get_posts`

You could try modifying the tax query to use the relation parameter and add a second clause that matches any post that does not have the matched string value in the meta array. See Taxonomy Parameters. EDIT: Thank you for pointing that out, Tom. You’re correct, I’ve updated to reflect. function group_matched_posts_at_top( $query ) { … Read more

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

ACF pro: Group teaser by datepicker year and display custom sub fields [closed]

The reason you can’t use ACF or functions such as the_title() is because they can only be accessed from inside The Loop (see here https://codex.wordpress.org/The_Loop). Its unnecessary to have multiple loops so I’ve merged them into one which will display any post data you need. Within this loop it checks whether the current post’s year … 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

Show related posts on single.php, grouped by taxonomy terms, with Advanced Custom Field post object selected

I’d recommend creating 3 separate [‘associated_items’] fields instead of 1. For Example: [‘associated_articles’] & “Filter for taxonomy term: Articles” [‘associated_presentations’] & “Filter for taxonomy term: Presentations” [‘associated_news’] & “Filter for taxonomy term: News” Note: Filtering for the taxonomy term, limits the related posts available to choose from as well, which results in a better user … Read more