Skip to content

Instantly share code, notes, and snippets.

View Mulli's full-sized avatar

Mulli Bahr Mulli

View GitHub Profile
/* Add the following right after the Form widget as HTML widget */
/* Assume name field with id="name" and email field with id="email" */
<script>
jq2 = jQuery.noConflict();
jq2(function( $ ) {
$(":submit").click(function(event){
let name = $("#form-field-name").val();
let email = $("#form-field-email").val();
// alert('submit clicked name='+name + " email="+email+"<<");
if ((name === undefined || name === "") && $('#name-err').length === 0)
@Mulli
Mulli / limit_post_title_words_in_archive.php
Last active December 6, 2021 19:20
Wordpress, limit number of words in post titles on archive pages only
<?php
// Display '...' on post titles in arcive pages
// Limit is 10 (default) if not defined in option: 'post_title_max_words'
// Range of values: 1..20.
// The non trivial issue is to affect only relevant post titles
// and ignore menu post titles and archive page post title
function s2g_short_post_title( $title, $id = null ) {
static $arc_data = null;
if (is_null( $id )) return $title; // ignore
@Mulli
Mulli / wp-survey-and-quiz-tool-he_IL.pot
Created February 14, 2013 22:55
Hebrew translation for WP Survey And Quiz Tool
# Copyright (C) 2012 WP Survey And Quiz Tool
# This file is distributed under the same license as the WP Survey And Quiz Tool package.
msgid ""
msgstr ""
"Project-Id-Version: WP Survey And Quiz Tool 2.12\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-survey-and-quiz-tool\n"
"POT-Creation-Date: 2012-12-06 13:51:41+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"