Skip to content

Conversation

@summersab
Copy link

Similar to Contact Form 7, FoxyShop loads its CSS on every page of the website. There may be better ways to handle this, but the way it is handled in CF7 is adding a filter that can be used like so:

add_filter( 'foxyshop_load_css', '__return_false' ); // Disable FS CSS
add_action('wp_enqueue_scripts', 'load_foxyshop_scripts');
function load_foxyshop_scripts() {
	//is_page can take an array that uses page title, slug, or ID such as array( 23, 'about-us', 'Contact' )
	if ( is_page( array( '235', 'daisies' ) ) ) {
		if ( function_exists( 'foxyshop_do_load_site_scripts' ) ) {
			foxyshop_do_load_site_scripts();
		} 
	}
}

This helps with PageSpeed and SEO.

Added two new filters to the foxyshop_product_variations function:

foxyshop_before_variation_field - allows adding code prior to the variation form field element
foxyshop_after_variation_field - allows adding code after the variation form field element
Added a $labelPosition option to the foxyshop_product_variations function to allow the variation titles to be displayed as placeholder values in the form field elements
Similar to Contact Form 7, FoxyShop loads its CSS on every page of the website. There may be better ways to handle this, but the way it is handled in CF7 is adding a filter that can be used like so:
```add_filter( 'foxyshop_load_css', '__return_false' ); // Disable CF7 CSS
add_action('wp_enqueue_scripts', 'load_foxyshop_scripts');
function load_foxyshop_scripts() {
	// is_page can take an array that uses Page Title, Page Slug or Page ID such as array( 23, 'about-us', 'Contact' )
    if ( is_page( array( '23', 'about-us', 'Contact' ) ) ) {
        if ( function_exists( 'foxyshop_load_site_scripts' ) ) {
            foxyshop_load_site_scripts();
        } 
    }
}```

This helps with PageSpeed and SEO.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant