Skip to content

Instantly share code, notes, and snippets.

@xlplugins
Last active July 23, 2024 08:21
Show Gist options
  • Save xlplugins/6bc907745e6ec891111931fc3727ec5f to your computer and use it in GitHub Desktop.
Save xlplugins/6bc907745e6ec891111931fc3727ec5f to your computer and use it in GitHub Desktop.
Funnelkit slider Shortcode on page
class FKCART_Shortcode {
public function __construct() {
add_action( 'after_setup_theme', [ $this, 'setup_theme' ] );
}
public function setup_theme() {
add_action( 'wp_footer', [ $this, 'remove_action' ] );
add_shortcode( 'fkcart_slider_on_page', [ $this, 'render' ] );
}
public function remove_action() {
$this->css();
remove_action( 'wp_footer', [ FKCart\Includes\Front::get_instance(), 'cart_icon' ], 20 );
remove_action( 'wp_footer', [ FKCart\Includes\Front::get_instance(), 'cart_content' ], 21 );
}
public function render() {
ob_start();
FKCart\Includes\Front::get_instance()->cart_content();
return ob_get_clean();
}
public function css() {
?>
<style>
#fkcart-modal .fkcart-modal-backdrop {
display: none !important;
}
#fkcart-modal {
position: relative !important;
display: block !important;
min-height: 400px;
z-index: 0;
}
#fkcart-modal .fkcart-preview-ui {
transform: translate(0) !important;
position: relative !important;
z-index: 0;
}
.fkcart-modal-close {
display: none !important;
}
.fkcart-trigger-open, .fkcart-trigger-open body{
overflow: inherit !important;
}
</style>
<?php
}
}
new FKCART_Shortcode();
@xlplugins
Copy link
Author

Paste this shortcode on your page
[fkcart_slider_on_page]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment