Skip to content

Instantly share code, notes, and snippets.

Marcio Duarte pagelab

Block or report user

Report or block pagelab

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pagelab
pagelab / mobtable.html
Created Jun 11, 2019 — forked from hkirsman/mobtable.html
turn tables into mobile friendly
View mobtable.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="et">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>table</title>
<style type="text/css">
.odd { background-color: #808080; }
.generated_for_mobile { margin-bottom: 30px }
@pagelab
pagelab / wpquery.php
Created May 23, 2019
Referência completa do WP_Query
View wpquery.php
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
//////Author Parameters - Show posts associated with certain author.
@pagelab
pagelab / trim-excerpt-whitespace.php
Created Apr 24, 2019 — forked from mindpalette/trim-excerpt-whitespace.php
WordPress Filter - Trim Excerpt Whitespace
View trim-excerpt-whitespace.php
<?php
// trim excerpt whitespace
if ( !function_exists( 'mp_trim_excerpt_whitespace' ) ) {
function mp_trim_excerpt_whitespace( $excerpt ) {
return trim( $excerpt );
}
add_filter( 'get_the_excerpt', 'mp_trim_excerpt_whitespace', 1 );
}
@pagelab
pagelab / wp-update.sh
Created Jan 24, 2019 — forked from bananana/wp-update.sh
Bash script to run automatic updates and backups using wp-cli
View wp-update.sh
#!/bin/bash
#
# Backup and update WordPress using wp-cli
#
# Set the -e shell option so the script exits immediately if any command within
# it exits with a non-zero status.
set -e
# Set PATH environment variable
@pagelab
pagelab / functions.hpp
Created Nov 26, 2018
Add a class to reflect the number of widgets in a given sidebar
View functions.hpp
<?php
/**
* Get number of active WordPress widgets in a widget area
*
* Snippet by GenerateWP.com
* Generated on November 26, 2018 15:47:27
* @link https://generatewp.com/snippet/2V0V0gy/
*/
/**
@pagelab
pagelab / IE11-grid-with-autoprefixer.md
Created Oct 31, 2018 — forked from pestbarn/IE11-grid-with-autoprefixer.md
CSS Grid for IE11 using Autoprefixer
View IE11-grid-with-autoprefixer.md

About: CSS Grid for IE11

CSS Grid in IE11 is an implementation based on the 2011 spec, which means we aren't really able to use grids out of the box according to the newer spec. However, Autoprefixer automates a lot of work for us with getting the correct IE11 properties, and it has support for most (if not all?) -ms-grid properties.

There are still some gotchas which Autoprefixer can't help with though:

  • There is no auto-placement behaviour in the 2011 spec. This means that for IE11, you have to position everything. rather than use the autoplacement ability of grid.
  • Using minmax() with an auto value is not supported, and will break things - e.g. minmax(auto, 1200px) will not work. To use minmax, you have to specify two positive values - e.g. minmax(500px, 1200px).
  • grid-gap properties were added in a later spec. To create grid-gaps in IE11, you will need to create separate
@pagelab
pagelab / README.md
Created Sep 3, 2018 — forked from ControlledChaos/README.md
Sanitization of WordPress Customizer controls
View README.md

Sanitize the WordPress Customizer

WordPress Snippets

View resposta-lucas.txt
Olá Flávio, tudo bem? 👋
O Épico é um conjunto de ferramentas e suporte para que você possa desenvolver o seu blog de sucesso.
Na prática, o Épico é um tema e um plugin para blogs profissionais em WordPress que elimina várias etapas para a criação de um blog realmente efetivo.
Ao adquirir o Épico, você vai receber:
• O tema e o plugin Épico: dois arquivos no formato zip para instalação no seu WordPress.
View Modificações no cabeçalho para conter todos os menus da navegação primária
/* Modificacoes no cabecalho para conter todos os menus da navegacao primaria */
@media screen and (min-width: 1020px) {
.author-profile .avatar {
width:96px;
}
}
@media screen and (min-width: 1020px) {
#branding {
width: 100%;
margin-right: 0%;
@pagelab
pagelab / wordpress-escaping.md
Created Jul 20, 2018 — forked from windyjonas/wordpress-escaping.md
Most of the escaping functions in WordPress, with a short explanation and example.
View wordpress-escaping.md

WordPress escaping functions

By: Jonas Nordström, @windyjonas
Date: 2013-04-16

esc_attr( $text );
Encodes the <, >, &, " and ' (less than, greater than, ampersand, double quote and single quote) characters. Will never double encode entities.
Example:

<div class="<?php echo esc_attr( $my_class ); ?>"></div>
You can’t perform that action at this time.