Skip to content

Instantly share code, notes, and snippets.

Avatar
👾

Hooman whoman

👾
View GitHub Profile
@whoman
whoman / wordpress-comments
Created May 3, 2021
Wordpress comments.php
View wordpress-comments
<?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') : ?>
@whoman
whoman / telegram-bot-button
Created May 3, 2021
add button to telegram bot (PHP)
View telegram-bot-button
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-social-sharing
Last active May 3, 2021
wordpress social sharing functions
View wordpress-social-sharing
<?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 / TOC html
Last active May 2, 2021
HTML table of content
View TOC html
<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>