Skip to content

Instantly share code, notes, and snippets.

@Aeonexe
Aeonexe / add-wordpress-settings-page.php
Created October 8, 2016 05:12 — forked from DavidWells/add-wordpress-settings-page.php
WordPress :: Add Settings Page with All Fields
<?php
/*
Plugin Name: Homepage Settings for BigBang
Plugin URI: http://www.inboundnow.com/
Description: Adds additional functionality to the big bang theme.
Author: David Wells
Author URI: http://www.inboundnow.com
*/
// Specify Hooks/Filters
@Aeonexe
Aeonexe / functions.php
Last active October 25, 2017 21:04
Wordpress User Agent Class
<?php
function wpkit_user_agent_class() {
global $is_lynx, $is_gecko, $is_IE, $is_winIE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_edge, $is_iphone;
$opera = strpos( $_SERVER['HTTP_USER_AGENT'], 'OPR');
$operaneon = strpos( $_SERVER['HTTP_USER_AGENT'], 'MMS');
$useragent = $_SERVER['HTTP_USER_AGENT'];
if( $is_lynx ) : echo ' linux';
@Aeonexe
Aeonexe / facebook-share
Last active October 7, 2020 21:55
Share page on facebook
<a href="https://www.facebook.com/sharer/sharer.php?u=<?= get_permalink(); ?>" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u=<?= get_permalink(); ?>','pagename','resizable,height=400,width=480'); return false;">
<i class="fa fa-facebook"></i>
</a>
<div class="videoWrapper videoWrapper169 js-videoWrapper">
<iframe class="videoIframe js-videoIframe" src="" frameborder="0" allowTransparency="true" allowfullscreen data-src="https://www.youtube.com/embed/hgzzLIa-93c?autoplay=1& modestbranding=1&rel=0&hl=sv"></iframe>
<button class="videoPoster js-videoPoster" style="background-image:url(http://i2.wp.com/www.cgmeetup.net/home/wp-content/uploads/2015/05/Avengers-Age-of-Ultron-UI-Reel-1.jpg);">Play video</button>
</div>
<button onclick="videoStop()">external close button</button>
@Aeonexe
Aeonexe / archive-product.php
Created April 3, 2018 17:39
Woocommerce Muestra el archivo por categorías, cata categoría linkea a su categoría hija hasta llegar al producto.
<?php
$parentid = get_queried_object_id();
$args = array(
'parent' => $parentid,
'childless' => false,
'hide_empty' => false,
'orderby' => 'count',
//'child_of' => 15,
// Añade una clase revisando si una clase en otro elemento existe
// después hace una iteración para añadir la clase a cada elemento
var elemento = document.querySelector('.elemento').classList.contains('.una-clase');
var li = document.querySelectorAll('.nav li');
if( elemento ) {
for( var e = 0; e < li.length; e++ ) {
li[e].classList.add('.clase-a-añadir');
}
}
@Aeonexe
Aeonexe / style
Created April 10, 2018 05:49
Mapas: clave : valor
$colors: (
"gray": '#eee',
"black": '#000',
"white": '#fff',
"red": '#ff4'
);
@each $color, $value in $colors {
.item-#{$color} {
background-color: $value;
@Aeonexe
Aeonexe / functions.php
Last active May 19, 2018 17:51
Cambia labels en el menú de administración
/**
* Cambia labels en el menú de administrador
*/
function change_post_menu_label() {
global $menu;
global $submenu;
$menu[5][0] = 'Proyectos';
$submenu['user-edit.php'][5][0] = 'Proyectos';
$submenu['user-edit.php'][10][0] = 'Publicar';
@Aeonexe
Aeonexe / php
Last active October 7, 2020 12:48
Visual Studio code snippets
{
// Place your snippets for php here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@Aeonexe
Aeonexe / scss
Last active June 29, 2020 18:43
{
// Place your snippets for scss here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",