Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Valeriu Tihai valeriu

🎯
Focusing
View GitHub Profile
View gist:dd3fd880683dda384fcd677a605c18b6
background: #ed3024;
color: #fff;
padding: 2px 5px;
position: absolute;
right: 0;
bottom: 0;
font-size: 12px;
@valeriu
valeriu / class-wp-bootstrap-navwalker.php
Last active November 28, 2020 05:18 — forked from imuhammadshoaib/class-wp-bootstrap-navwalker.php
Make parent link clickable in Bootstrap for Desktop with WordPress NavWalker
View class-wp-bootstrap-navwalker.php
if (wp_is_mobile()){
$atts['href'] = '#';
$atts['data-toggle'] = 'dropdown';
$atts['aria-haspopup'] = 'true';
$atts['aria-expanded'] = 'false';
$atts['class'] = 'dropdown-toggle nav-link';
$atts['id'] = 'menu-item-dropdown-' . $item->ID;
} else {
$atts['href'] = ! empty( $item->url ) ? $item->url : '';
$atts['aria-haspopup'] = 'true';
View woo.sql
//woocomerce table missing after wc uptate to 4.0.0
CREATE TABLE IF NOT EXISTS wp_wc_admin_notes (
note_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
name varchar(255) NOT NULL,
type varchar(20) NOT NULL,
locale varchar(20) NOT NULL,
title longtext NOT NULL,
content longtext NOT NULL,
icon varchar(200) NOT NULL,
View gist:5679217552968d50b0e2c140dc7ca822
http://ical-cdn.teamsnap.com/team_schedule/c132880d-10c3-47d4-b1ec-88fcfd7d14e3.ics
View gist:b839d9dc81c55b5da133c64a2c58b3ca
// Foundation for Sites Settings
// -----------------------------
//
// Table of Contents:
//
// 1. Global
// 2. Breakpoints
// 3. The Grid
// 4. Base Typography
// 5. Typography Helpers
View wp-logo+svg.php
<?php
/* -------------------------------------------------------------
* Custom Logo add this in "after_setup_theme" hook
* ============================================================*/
add_theme_support( 'custom-logo' );
/* -------------------------------------------------------------
* Enable svg support
* ============================================================*/
View gist:a577296e2962fc24e633f1e5d91f7e60
<style type="text/css">
.dropdown-menu {
border-bottom:1px solid red;
}
.current-nav-parent > .dropdown-menu{
border: 4px solid red;
}
.current-nav-parent > .dropdown-menu{border-bottom:0}
</style>
@valeriu
valeriu / wp-htaccess.sh
Created July 6, 2017 00:58
http to https
View wp-htaccess.sh
# Redirect http to https .htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
# Redirect http to https apache
<VirtualHost *:80>
ServerName www.example.com
View colorbtn.css
.btn-new-color {
background-image: linear-gradient(#DCA, #DDB);
border-color: #B5A0A0;
color: #4C3D3D !important;
&:hover {
background-color: #DDD8B6;
}
}
View gist:0f42ed0a82a29ac52496
/*------------------------------------------------------------
* Get Attachment ID from image src
* Author: http://stylishwp.com/
============================================================*/
if ( ! function_exists( 'swp_get_attachment_id_from_src' ) ) :
function swp_get_attachment_id_from_src ( $image_src ) {
global $wpdb;
$id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid = %s", $image_src) );
return $id;
}