Last active
July 23, 2024 08:21
-
-
Save xlplugins/6bc907745e6ec891111931fc3727ec5f to your computer and use it in GitHub Desktop.
Funnelkit slider Shortcode on page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Paste this shortcode on your page
[fkcart_slider_on_page]