is_main_query() && ( $query->is_post_type_archive( 'avada_portfolio' ) || $query->is_tax( [ 'portfolio_category', 'portfolio_skills', 'portfolio_tags' ] ) ) ) { // If TO setting is set to 0, all items should show. $number_of_portfolio_items = Avada()->settings->get( 'portfolio_archive_items' ); $query->set( 'posts_per_page', $number_of_portfolio_items ); } return $query; } /** * Set portfolio width and assign a class to the content div * * @param string $classes The CSS classes. * @return string */ public function set_portfolio_single_width( $classes ) { if ( is_singular( 'avada_portfolio' ) ) { $portfolio_width = 'half' === fusion_get_option( 'portfolio_featured_image_width' ) ? 'half' : 'full'; if ( ! Avada()->settings->get( 'portfolio_featured_images' ) && 'half' === $portfolio_width ) { $portfolio_width = 'full'; } $classes .= ' portfolio-' . $portfolio_width; } return $classes; } } /* Omit closing PHP tag to avoid "Headers already sent" issues. */