Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@timba64
timba64 / code.js
Last active November 26, 2018 09:24
Create custom menu in google spreadsheet, get unread email from google account and put it in google sheets
function onOpen(e) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.addMenu("Меню для Оли",
[{ name: "Write to file", functionName: "writeToFile" },
{ name: "Remove Duplicates", functionName: "removeDuplicates" },
{ name: "Count lids", functionName: "countLids" }]
);
}
/**
@timba64
timba64 / func-help.php
Last active July 17, 2018 12:37
add page Help in menu in admin area of wordpress
add_action('admin_menu', function(){
add_menu_page( 'Myway | Помощь', 'Помощь', 'edit_pages', 'help', 'add_help_page', 'dashicons-editor-help', 4 );
} );
function add_help_page() {
include 'helpix.php';
}
@timba64
timba64 / functions.php
Last active October 26, 2018 09:20
some functions for Wordpress
//add styles only on one page of admin area Wordpress
add_action( 'admin_enqueue_scripts', 'add_css_help_page' );
function add_css_help_page( $hook ){
//wp_die($hook);
// output help.css only on help page in admin zone
if($hook != 'toplevel_page_help') {
return;
}
wp_enqueue_style( 'css-help-admin', get_template_directory_uri() .'/help.css' );
}
@timba64
timba64 / functions.php
Last active July 16, 2018 07:34
remove quantity in woocommerce categories
//убираем количество в категориях
add_filter('woocommerce_subcategory_count_html','remove_count');
function remove_count(){
$html='';
return $html;
}
@timba64
timba64 / .htaccess
Last active October 26, 2018 09:28 — forked from vielhuber/.htaccess
Apache: htaccess force www and https ssl #server and some others rules
# last working way - http to https
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
</IfModule>
# force HTTPS and www.
RewriteEngine On
RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]