Skip to content

Instantly share code, notes, and snippets.

View denisstoyanov's full-sized avatar

Denis Stoyanov denisstoyanov

  • Varna, Bulgaria
View GitHub Profile
<style>
* {-webkit-text-size-adjust: none}
</style>
or
<font style=”-webkit-text-size-adjust: none”>
Example
</font>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@id": "https://expert-doors.com/#organization",
"@type": "Organization",
"name": "Врати Експерт",
"url": "https://expert-doors.com/",
"logo": "https://expert-doors.com/wp-content/uploads/2017/02/ExpertDOORlogo.png",
"location":
[{
<?php
if ($category->term_id === 57) {
if ( woocommerce_product_loop() ) {
/**
* Hook: woocommerce_before_shop_loop.
*
* @hooked wc_print_notices - 10
@denisstoyanov
denisstoyanov / single-product-excerpt.php
Last active October 3, 2018 08:36
Removes short description in WooCommerce Single Product page
<?php
/* Source: https://wordpress.stackexchange.com/a/98251 */
function wpa_98244_filter_short_description( $desc ){
global $product;
if ( is_single( $product->id ) )
$desc = '';
@denisstoyanov
denisstoyanov / unzipfile.php
Created December 14, 2015 20:58
Unzip WordPress (when using FTP)
<?php
$file = 'wordpress-4.2.5.zip';
$path = pathinfo(realpath($file), PATHINFO_DIRNAME);
$zip = new ZipArchive;
$res = $zip->open($file);
if ($res === TRUE) {
$zip->extractTo($path);
$zip->close();
@denisstoyanov
denisstoyanov / deletecomments.php
Created November 6, 2015 08:48
Deletes all comments
<?php
function delete_all_comments() {
$comments = get_comments();
foreach($comments as $comment) {
wp_delete_comment($comment->comment_ID, true);
}
}
delete_all_comments()
// Deletes all themes except the active one
function delete_not_active_themes() {
if (!function_exists('delete_theme')) {
require_once(ABSPATH . WPINC . '/pluggable.php');
require_once(ABSPATH . 'wp-admin/includes/file.php');
require_once(ABSPATH . 'wp-admin/includes/theme.php');
}
$themes = wp_get_themes();
$current_theme = wp_get_theme();
@denisstoyanov
denisstoyanov / get_all_apache_modules.php
Last active September 25, 2015 18:53
PHP (or WP Replated) Functions
<?php
print_r(apache_get_modules());