tomgiannelli
Forum Replies Created
-
That’s right I’m trying to create shortcode that I can pass the team ID to so it pulls the staff from a particular team. what I’ve been using so far will pull the staff in the whole DB
I was trying to create a custom function…
function custom_team_staff_list_shortcode( $atts ) {
// Set default arguments
$args = shortcode_atts( array(
‘team’ => ”, // Team ID or slug
‘role’ => ”, // Job or Role (e.g., ‘Coach’, ‘Manager’)
‘limit’ => 10, // Number of staff members
), $atts );// Set up the tax_query and meta_query arrays $tax_query = array(); $meta_query = array(); // Add team filter if team is specified if ( ! empty( $args['team'] ) ) { $tax_query[] = array( 'taxonomy' => 'sp_team', // Taxonomy for teams 'field' => is_numeric( $args['team'] ) ? 'term_id' : 'slug', // Check if the team is ID or slug 'terms' => $args['team'], 'operator' => 'IN', ); } // Add role/job filter if role is specified if ( ! empty( $args['role'] ) ) { $meta_query[] = array( 'key' => 'job', // Assuming 'job' is the meta key for role/job 'value' => $args['role'], 'compare' => '=', // Exact match ); } // If both tax_query and meta_query are set, wrap them in 'relation' => 'AND' $query_args = array( 'post_type' => 'sp_staff', 'posts_per_page' => $args['limit'], 'tax_query' => $tax_query, // Filter by team 'meta_query' => $meta_query, // Filter by role/job ); // If both tax_query and meta_query exist, combine them using 'AND' if ( ! empty( $tax_query ) && ! empty( $meta_query ) ) { $query_args['tax_query']['relation'] = 'AND'; } // Query the staff members $staff_query = new WP_Query( $query_args ); // Start output buffering ob_start(); if ( $staff_query->have_posts() ) { echo '<ul class="team-staff-list">'; while ( $staff_query->have_posts() ) { $staff_query->the_post(); ?> <li class="staff-item"> <h3><?php the_title(); ?></h3> <p><?php echo get_post_meta( get_the_ID(), 'job', true ); // Display the job/role ?></p> <p><?php the_content(); ?></p> </li> <?php } echo '</ul>'; } else { echo '<p>No staff found.</p>'; } // Reset post data wp_reset_postdata(); // Return the output return ob_get_clean();}
add_shortcode( ‘team_staff_list’, ‘custom_team_staff_list_shortcode’ );but I don’t think it’s right…
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] Getting Started – Some questionshey Savvas – sorry for late reply, I got some stuff working (atleast elementor builds now. what I’m still trying to do is the team page…
https://staging-0ce0-thundervolleyballca.wpcomstaging.com/team/16u-white-2/if you can see that example, the two coaches I manually added their profile via shortcode. the playerlist was okay…
if I can figureout a shortcode query to pullin the coaches for the team based on their team assignments I think I’m good.
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] Getting Started – Some questionsseems sportpress is conflicting with elementor. anyone seen that before? when I disable SportPress, elementor works. when it’s enables, there are server errors.
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] Getting Started – Some questionsthats exactly what I did was update the events calendar plugin and then at least the page loads, but no sportspress content.
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] Getting Started – Some questionsHi Savvas – I got the page to load now but not seeing the sportpress items in there… included a screen grab
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] Getting Started – Some questionsokay got it… thank you. I will have to wait and see what the theme developer comes back with…
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] Getting Started – Some questionsI don’t see anything on the front end just yet because of that PHP error that was mentioned earlier in the thread.
is the “0” value in the Team edit page irrelevant? or should the be a count? when I look in the demo data there for sport press I do see a player count assigned…
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] Getting Started – Some questionsForum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] Getting Started – Some questionshere you go.
player list – https://snipboard.io/DoxvAQ.jpg
Player – Lucy G should be on team 16U – White – https://snipboard.io/CY70wB.jpg
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] Getting Started – Some questionssomething to add is that I imported the teams, staff & players (in that order) using the import tool. rather than entering them one by one.
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] Getting Started – Some questionsyes can confirm that too I was trying to upload a screenshot for you but it’s not work… I created a brand new league just to test… called it Volleyball and assigned it to the players, teams, staff and playerlists… and I still see a 0 in the number inside the teams edit page.
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] Getting Started – Some questionsyes I can confirm that all the players, staff & team all ahve the same league and season
- This reply was modified 1 year, 4 months ago by tomgiannelli.
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] Getting Started – Some questionsTHat solved for the blank page, what about this problem?
Problem 1 – I’ve assigned Staff and a Players List to the Team. The playerlist shows 0 players when I edit the team.
That seems like a setting in the SportPress plugin somewhere but I looked everywhere…
IF I look in the player list it is populated.
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] Getting Started – Some questionsthanks Savvas – gave that a try but same result have opened a ticket with the theme developer.