Skip to content

Instantly share code, notes, and snippets.

{"component":{"id":11,"name":"ct_div_block","options":{"ct_id":11,"ct_parent":2,"selector":"div_block-11-263","original":{},"nicename":"Lists","activeselector":"oxel_icon-list","classes":["oxel_icon-list"]},"depth":3,"children":[{"id":6,"name":"ct_div_block","options":{"ct_id":6,"ct_parent":11,"selector":"div_block-6-263","original":{},"nicename":"List","activeselector":"oxel_icon-list__item","classes":["oxel_icon-list__item"],"last-of-type .oxel_icon-list__item-flex-line":{}},"depth":4,"children":[{"id":7,"name":"ct_div_block","options":{"ct_id":7,"ct_parent":6,"selector":"div_block-7-263","original":{},"nicename":"Icon Wrap","activeselector":"oxel_icon-list__item-flex","classes":["oxel_icon-list__item-flex"],"last-of-type .oxel_icon-list__item-flex-line":{}},"depth":5,"children":[{"id":9,"name":"ct_fancy_icon","options":{"ct_id":9,"ct_parent":7,"selector":"fancy_icon-9-263","original":{"icon-id":"FontAwesomeicon-circle-o"},"nicename":"Icon","activeselector":"oxel_icon-list__item-flex-icon","classes":["oxel_
@hssktm
hssktm / gist:5ffd5ee6b0cb4d2152e1fa1c836c796e
Created March 21, 2025 05:23
MEGA MENU MODERN OXYGEN
JSON Header and Menu
{"component":{"id":53,"name":"ct_div_block","options":{"ct_id":53,"ct_parent":0,"selector":"div_block-53-125","original":{"useCustomTag":"true","tag":"header","width":"100","width-unit":"%","position":"fixed","top":"10","z-index":"9999"},"nicename":"Header"},"depth":1,"children":[{"id":3,"name":"ct_div_block","options":{"ct_id":3,"ct_parent":53,"selector":"div_block-3-125","original":{"width":"max-content","width-unit":" ","useCustomTag":"true","tag":"nav","flex-direction":"row","display":"flex","align-items":"center","justify-content":"space-between","background-color":"#303030","border-radius":"1","border-radius-unit":"rem","padding-right":"6","padding-left":"6","height":"50","margin-left-unit":"auto","margin-right-unit":"auto","position":"relative","gap":"1","gap-unit":"rem"},"nicename":"Nav","activeselector":false,"media":{"tablet":{"original":{"width":"90","width-unit":"%"}}}},"depth":2,"children":[{"id":7,"name":"ct_div_block","options":{"ct_id":7,"ct_parent":3,"selector":"div_block
This element works as follows: there are several key classes like x-mega,
and within this, you can use x-mega-activate to activate the mega menu.
Additionally, you can use x-mega-activate and x-mega-deactivate to activate
or deactivate the menu, respectively.
x-mega contains some key attributes that you can use to configure the mega menu,
such as data-mega-open, which lets you activate the menu with a click or hover.
There is also data-mega-transition, which you can set, for example, to 0.5s to
define the animation duration. Similarly, there is data-mega-scroll, which you
{"component":{"name":"ct_div_block","id":104,"options":{"nicename":"Accordion Basic","selector":"div_block-104-210","ct_id":104,"ct_parent":0},"children":[{"id":105,"name":"ct_div_block","options":{"ct_id":105,"ct_parent":104,"selector":"div_block-105-210","original":{"custom-attributes":[{"name":"data-accordion-multi-collapsable","value":"false","pinned":true},{"name":"data-accordion-transition-duration","value":"0.3s","pinned":true},{"name":"data-accordion-center","value":"false","pinned":true},{"name":"data-accordion-anchor","value":"20px"}],"gap":"15"},"nicename":"Accordions","classes":["x-accordions"],"nth-child(2) .ct-div-block":[],"nth-child(n) .x-accordion:nth-child(2) .ct-div-block":[],"nth-child(n) .x-accordion .ct-div-block:nth-child(2)":[]},"depth":2,"children":[{"id":106,"name":"ct_div_block","options":{"ct_id":106,"ct_parent":105,"selector":"div_block-106-210","original":{"custom-attributes":[{"name":"data-accordion","value":"open","pinned":true}]},"nicename":"Accordion","classes":["x-accordion"
@hssktm
hssktm / Per page Woocommerce
Created May 16, 2025 05:42
Per page Woocommerce
add_filter('woocommerce_get_settings_products', 'add_products_per_page_setting', 10, 2);
function add_products_per_page_setting($settings, $current_section) {
if ('' === $current_section) {
$new = array();
foreach ($settings as $setting) {
$new[] = $setting;
if (isset($setting['id']) && 'woocommerce_shop_page_id' === $setting['id']) {
$new[] = array(
'title' => __('Products per page', 'woocommerce'),
'desc' => __('Number of products to display per page on shop archives.', 'woocommerce'),
@hssktm
hssktm / Comments Woocommerce Error Messages
Created May 26, 2025 02:46
Comments Woocommerce Error Messages
add_action('wp_ajax_check_duplicate_comment','check_duplicate_comment');
add_action('wp_ajax_nopriv_check_duplicate_comment','check_duplicate_comment');
function check_duplicate_comment(){
$post_id = intval($_POST['post_id'] ?? 0);
$content = trim(wp_unslash($_POST['content'] ?? ''));
$user_id = get_current_user_id();
global $wpdb;
$exists = $wpdb->get_var($wpdb->prepare(
"SELECT comment_ID FROM {$wpdb->comments} WHERE comment_post_ID=%d AND user_id=%d AND comment_content=%s AND comment_approved!='spam'",
$post_id, $user_id, $content