Add post meta if content has WP Tasty

add_filter( ‘tasty_pins_old_attributes_migration_content’, function ( $content, $post ) { if ( str_contains( $content, ‘WP Tasty’ ) ){ update_post_meta( $post->ID, ‘wp-tasty-here’, true ); } // You can also change $content to modify the contents of the post. return $content; }, 10, 2…Continue reading

Show more Landings

document.addEventListener(“DOMContentLoaded”, function () { // Get all Read More buttons const readMoreButtons = document.querySelectorAll(‘.read-more’); readMoreButtons.forEach(button => { button.addEventListener(‘click’, function (event) { event.preventDefault(); const feature = this.closest(‘.feature’); const longDesc = feature.querySelector(‘.long-desc’); const shortDesc = feature.querySelector(‘.short-desc’); if (longDesc.style.display === “none”) { longDesc.style.display…Continue reading

CSS – Ajout de Ninja Tables

/* Ajout de Ninja Tables */ .footable .open>.dropdown-menu { display: block !important; } .footable .dropdown-menu{ display: none !important; } .container { overflow: initial !important; } .post-page-numbers { border: 1px solid rgb(0 0 0); padding: 5px 10px; border-radius: 5px; }Continue reading

CSS – listes

@property –nat-li-icon { syntax: ““; inherits: false; initial-value: disc; } @property –nat-bgcolor { syntax: ““; inherits: false; initial-value: white; } @property –nat-color { syntax: ““; inherits: false; initial-value: black; } /* Pour les listes */ .nat-li-tkome {–nat-li-icon:”※ “;} .nat-li-tnote {–nat-li-icon:”Note…Continue reading

css – Pour les images

/* Formattage des images */ img.natha { vertical-align: baseline;} .nath-text-top { vertical-align: text-top; } .nath-align-text-bottom { vertical-align: text-bottom; } .nath-align-sub { vertical-align: sub; } .nath-align-super { vertical-align: super; } .nath-size-square-50px { height : 50px; } .nath-img120par80 { height: 120px; width:…Continue reading

Customize Gift Card Code

/* Customize the generated Gift Card Code */ function agcfw_change_prefix() { return array( ‘characters’ => ‘ABCDEFGHJKMNPQRSTUVWXYZ23456789’, // Defines the characters used in the coupon code ‘length’ => 10, // Sets the length of the generated code to 10 characters ‘prefix’…Continue reading

The draft of receipt

from reportlab.lib.pagesizes import A4 from datetime import datetime from reportlab.platypus import Table, TableStyle, Paragraph, SimpleDocTemplate, Image, Frame, PageTemplate from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet current_time = datetime.now() curr_date = current_time.date() time = current_time.strftime(“%H:%M:%S”) receipt_no = current_time.strftime(“%y%m%d%H%M%S”) # Style…Continue reading