Skip to content

Instantly share code, notes, and snippets.

View txid0x7f's full-sized avatar
🇺🇦

Vova Gabel txid0x7f

🇺🇦
View GitHub Profile
<div class="comments wrapper">
<h4 class="comments__title">Leave a Comment</h4>
<ul class="comments__list">
<?php
$comments_args = array(
'hierarchical' => 'threaded',
);
$comments = get_comments($comments_args);
foreach ($comments as $comment) { ?>
<li class="comments__item">
add_shortcode('wp_caption', 'fixed_img_caption_shortcode');
add_shortcode('caption', 'fixed_img_caption_shortcode');
function fixed_img_caption_shortcode($attr, $content = null)
{
if (!isset($attr['caption'])) {
if (preg_match('#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is', $content, $matches)) {
$content = $matches[1];
$attr['caption'] = trim($matches[2]);
}
<?php
namespace ElementorPro\Modules\Posts\Skins;
use Elementor\Controls_Manager;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Skin_Custom extends Skin_Base {
public function get_id() {
function strip_entire_image_class($html) {
return preg_replace('/ class="(.*)"/', '', $html);
}
add_filter('get_image_tag', 'strip_entire_image_class', 0, 4);
$('.menu-toggle').on('click', function () {
$(this).toggleClass('menu-toggle--on');
$('.header__nav-mobile').toggleClass('header__nav-mobile--on');
$('nav ul').toggleClass('hidden');
});
function trim_title_chars($count, $after) {
$title = get_the_title();
if (mb_strlen($title) > $count) $title = mb_substr($title, 0, $count);
else $after = '';
echo $title . $after;
}