WordPress.org

Support

Support » Plugins and Hacks » Team Rosters » [Resolved] Gallery displays only five members

[Resolved] Gallery displays only five members

  • Hi Mark

    First I want to thank you for this plugin, I think you are doing a great job with both the plugin and support.

    The problem that I have been having is that I can only get 5 team members to display at any given time. Im not quite sure where to begin to trouble shoot this issue. I suspect that it might have something to do with my theme. I am using the Catalyst theme which is not your typical theme. If I had to compare it to anything I would say it is similar to Thesis. I am also running the most current version of this plugin.

    Here is the url link to my gallery page. http://londongryphons.com/teams/aaa/
    Any input you can give me would be greatly appreciated.

    http://wordpress.org/extend/plugins/team-rosters/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Mark O'Donnell

    @markodonnell

    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

    Plugin Author Mark O'Donnell

    @markodonnell

    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?

    Plugin Author Mark O'Donnell

    @markodonnell

    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.

    Plugin Author Mark O'Donnell

    @markodonnell

    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

    Plugin Author Mark O'Donnell

    @markodonnell

    So I think pstevens17 posted that he fixed his problem in another topic/thread. Is anyone else still having problems?
    -Mark

    Plugin Author Mark O'Donnell

    @markodonnell

    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

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] Gallery displays only five members’ is closed to new replies.
Skip to toolbar