Skip to content

Instantly share code, notes, and snippets.

View whoman's full-sized avatar
👾

Hooman whoman

👾
View GitHub Profile
@whoman
whoman / TOC html
Last active May 2, 2021 05:42
HTML table of content
<ol>
<li><a href="/permalink/#subheading-1">Subheading 1</a></li>
<li><a href="/permalink/#subheading-2">Subheading 2</a></li>
<li><a href="/permalink/#subheading-3">Subheading 3</a></li>
<li><a href="/permalink/#subheading-4">Subheading 4</a></li>
<li><a href="/permalink/#subheading-5">Subheading 5</a></li>
<li><a href="/permalink/#subheading-6">Subheading 6</a></li>
<li><a href="/permalink/#subheading-7">Subheading 7</a></li>
<li><a href="/permalink/#subheading-8">Subheading 8</a></li>
<li><a href="/permalink/#subheading-9">Subheading 9</a></li>
@whoman
whoman / wordpress-social-sharing
Last active February 9, 2023 22:58
wordpress social sharing functions
<?php
/*
http://darkoobweb.com/?p=1700
shortcode to use: <?php echo do_shortcode('[darkoobweb_social_sharing]') ; ?>
*/
function darkoobweb_social_sharing()
{
extract(shortcode_atts(array(), $atts));
return'
<div id="social-sharing-container">
@whoman
whoman / telegram-bot-button
Created May 3, 2021 09:33
add button to telegram bot (PHP)
ini_set('error_reporting', 'E_ALL');
$botToken = "273759407:AAEOqgo3I5nob3jIGzkY1ihguhPbXl945RQ";
$webSite = "https://api.telegram.org/bot" . $botToken;
$update = file_get_contents("php://input");
$update = json_decode($update, TRUE);
$chatId = $update["message"]["chat"]["id"];
$message = $update["message"]["text"];
//CustomKeyBord
$option = array(array("salam", "Key1"), array("key2", "key3"));
$replyMarkup = array(
@whoman
whoman / wordpress-comments
Created May 3, 2021 10:28
Wordpress comments.php
<?php if(!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) : ?>
<?php die('You can not access this page directly!'); ?>
<?php endif; ?> <?php if(!empty($post->post_password)) : ?>
<?php if($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>
This post is password protected. Enter the password to view comments.
<?php endif; ?><?php endif; ?> <?php if($comments) : ?>
<ol>
<?php foreach($comments as $comment) : ?>
<li id="comment-<?php comment_ID(); ?>">
<?php if ($comment->comment_approved == '0') : ?>