WordPress.org

Ready to get started?Download WordPress

Forums

Team Rosters
[resolved] Gallery displays only five members (11 posts)

  1. udaman1970
    Member
    Posted 1 year ago #

    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/

  2. Mark O'Donnell
    Member
    Plugin Author

    Posted 1 year ago #

    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

  3. Mark O'Donnell
    Member
    Plugin Author

    Posted 1 year ago #

    OBTW, there are cleaner ways to omit the player weights. Check the readme.
    -Mark

  4. udaman1970
    Member
    Posted 1 year ago #

    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?

  5. Mark O'Donnell
    Member
    Plugin Author

    Posted 1 year ago #

    Yes. Unless you create a child theme and add it to functions.php in the child theme directory.

    -Mark

  6. squeener
    Member
    Posted 1 year ago #

    I updated my functions.php with the above code snippet but it did not work. Still only showing 5. Thoughts?

  7. udaman1970
    Member
    Posted 1 year ago #

    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.

  8. Mark O'Donnell
    Member
    Plugin Author

    Posted 1 year ago #

    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

  9. pstevens17
    Member
    Posted 1 year ago #

    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

  10. Mark O'Donnell
    Member
    Plugin Author

    Posted 1 year ago #

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

  11. Mark O'Donnell
    Member
    Plugin Author

    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic