Hi udaman1970,
Nice site. You are almost there.
I think you’re right, the theme is restricting the number of posts returned by WPQuery. Add the following lines to functions.php to filter the base WP query:
function mstw_tr_gallery_size( $query ) {
if ( is_admin() || ! $query->is_main_query() )
return;
if ( is_tax( 'teams' ) ) {
// Display up to 120 posts for teams taxonomy archive pages
$query->set( 'posts_per_page', 120 );
return;
}
}
add_action( 'pre_get_posts', 'mstw_tr_gallery_size', 1 );
-Mark
OBTW, there are cleaner ways to omit the player weights. Check the readme.
-Mark
Mark
Thank you, Thank you, Thank you. It worked quite nicely. U da Man!
One quick question. Will this update I made to the functions.php file disappear if I update this theme?
Yes. Unless you create a child theme and add it to functions.php in the child theme directory.
-Mark
I updated my functions.php with the above code snippet but it did not work. Still only showing 5. Thoughts?
First are you using the Catalyst theme? I initially had problems but Catalyst is different from your typical theme and you have to put the code snippet in the right place. If you are using Catalyst and have dynamic skins installed (which is what is recommended) then you want to edit the Dynamik: custom-functions.php. I would recommend copying this file before you edit it. I hope that helps.
squeener,
I think udaman1970 is on the right track. If you are using a ‘premium theme’ or a ‘theme framework’, they may be messing with things in a number of places and it’s possible that they get in to the ‘pre_get_posts’ action last or that they have provided their own custom hook. [BTW, if you are using such ‘frameworks’ you should be using child themes, not messing with their core stuff. That’s a path to upgrade hell.]
-Mark
I’ve got the same problem, team gallery only shows 10 players. Roster show 11 just fine. My problem is that I do not have a functions.php file. I tried putting the code in the theme function php but that didn’t work.
I am using presswork theme, my site is clippersbaseballsouth.com.
You’ll see the roster lists 11 plays but the last one is not showing on the gallery page
So I think pstevens17 posted that he fixed his problem in another topic/thread. Is anyone else still having problems?
-Mark
Having heard nothing in over a month, I am marking this thread resolved. Please open a new thread if you have further questions/issues.
Thanks.
-Mark