Tagged: x
-
AuthorPosts
-
September 9, 2016 at 9:14 am #1168007
andrewtegParticipantWe have author pages such as http://northstarfamily.org/author/jeff-noble/ and were able to add a blurb at the top with some help of the forum and using an action in our functions.php file.
However, I’d like to also have that page not show any posts that are categorized as News (slug=news, id=17) since our News postings are usually just random and not author specific.
1) Is it possible to add something to filter out that category? If so, where?
2) If that is beyond the scope of what you can do here, can you tell me how to create a new author index page in my child theme that I can customize? I believe from other themes I need to find the loop and look for and change query_posts and the_post like this:
<?php query_posts($query_string . 'cat=-92'); while ( have_posts() ) : the_post(); ?>
However, I’m not sure where that is in X since I’ve only modified a few child theme files and wp-index.php in framework/views/integrity/ does not have query_posts or the_post() inside.Thanks,
AndrewSeptember 9, 2016 at 5:54 pm #1168595
RadModeratorHi Andrew,
Thanks for writing in.
Please add this code to your child theme’s functions.php
function exclude_some_category( $query ) { if ( $query->is_author() && $query->is_main_query() ) { $query->set( 'cat', '-92' ); } } add_action( 'pre_get_posts', 'exclude_some_category' );Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1168007 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
