Gravity Forms email template

// adjust HTML template of emails function notification_template( $template ) { $siteurl = ‘https://aveni.ai’; $logourl = ‘https://aveni.ai/wp-content/themes/aveni/assets/img/aveni-logo-white.png’; $logoalt = ‘Aveni AI’; $email = ‘[email protected]’; $themecolor= ‘#1B223A’; $template = ‘ {subject} {message} Aveni AI – Cutting-edge speech analytics for regulated industries…Continue reading

Scroll Progress Bar

add_action(‘wp_body_open’, function() { echo ‘ ‘; }); add_action(‘wp_head’, function() { echo ‘ ‘; }); add_action(‘wp_footer’, function() { echo ‘‘; });Continue reading

Display Reading Time

$reading_speed = 200; // 200 words per minute $content = get_post_field( ‘post_content’, get_the_id() ); $word_count = str_word_count( strip_tags( $content ) ); $reading_time = ceil( $word_count / $reading_speed ); echo ‘ Estimated reading time: ‘ . absint( $reading_time ) . ‘…Continue reading

Add ID column in admin tables

add_action( ‘admin_init’, function () { // Get all public post types $post_types = get_post_types( array(), ‘names’ ); function wpcode_add_post_id_column( $columns ) { $columns[‘wpcode_post_id’] = ‘ID’; // ‘ID’ is the column title return $columns; } function wpcode_show_post_id_column_data( $column, $post_id ) {…Continue reading

Post Meta Debugger

add_action( ‘add_meta_boxes’, function () { if ( ! current_user_can( ‘manage_options’ ) ) { // Don’t display the metabox to users who can’t manage options return; } add_meta_box( ‘wpcode-view-post-meta’, ‘Post Meta’, function () { $custom_fields = get_post_meta( get_the_ID() ); ?> Meta…Continue reading

Table des matières – Blog

function create_toc($html) { $toc = ”; if (is_single()) { if (!$html) return $html; $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML(mb_convert_encoding($html, ‘HTML-ENTITIES’, ‘UTF-8’)); libxml_clear_errors(); $toc = ‘ Navigation rapide ‘; $h2_status = 0; $h3_status = 0; $i = 1; foreach($dom->getElementsByTagName(‘*’) as $element)…Continue reading

Table des matières – Blog

function create_toc($html) { $toc = ”; if (is_single()) { if (!$html) return $html; $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML(mb_convert_encoding($html, ‘HTML-ENTITIES’, ‘UTF-8’)); libxml_clear_errors(); $toc = ‘ Navigation rapide ‘; $h2_status = 0; $h3_status = 0; $i = 1; foreach($dom->getElementsByTagName(‘*’) as $element)…Continue reading