Skip to content

Instantly share code, notes, and snippets.

View lincolnlemos's full-sized avatar

Lincoln Lemos lincolnlemos

View GitHub Profile
@lincolnlemos
lincolnlemos / gist:3943197
Created October 24, 2012 01:37 — forked from bueltge/gist:757903
This WordPress Plugin demonstrates how you can build your own plugin pages using the WordPress provided draggable metaboxes, requires WordPress 2.7 version, supports WordPress 2.8 changed boxing layout engine
<?php
/*
Plugin Name: HowTo Plugin
Plugin URI:
Description: This Plugin demonstrates how you can build your own plugin pages using the WordPress provided draggable metaboxes, requires WordPress 2.7 version, supports WordPress 2.8 changed boxing layout engine
Author: Heiko, Frank
Author URI: http://bueltge.de
Version: 0.1
License:
<?php
/**
* Custom Loop Add to Cart.
*
* Template with quantity and ajax.
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
global $product;
<?php if( have_rows('collapse') ): ?>
<div id="accordion" role="tablist">
<?php $i=1; while ( have_rows('collapse') ) : the_row(); ?>
<div class="card">
<div class="card-header" role="tab" id="heading-<?php echo $i; ?>">
<h5 class="mb-0">
<a data-toggle="collapse" href="#collapse-<?php echo $i; ?>" aria-expanded="true" aria-controls="collapseOne">
<?php the_sub_field('title'); ?>
</a>
</h5>
<?php
$depoimentos = get_field( 'depoimentos' );
if ($depoimentos) {
echo '<div id="depoimentos-wrapper" class="">',
foreach ($depoimentos as $depoimento) { extract($depoimento);
$imgsrc = $imagem ? $imagem['src'] : '';
echo '<div class="depoimento-item d-flex">',
($imgSrc ? '<div class="image-box"><img src="'.$imgSrc.'" class="img-fluid"></div>' : ''),
'<div>',
($titulo ? '<h2>'.$titulo.'</h2>' : ''),
@lincolnlemos
lincolnlemos / functions.php
Created October 14, 2017 18:51 — forked from cjmosure/functions.php
WP-PageNavi - Bootstrap 4
<?php
/**
* Clean up pagination
*/
add_filter( 'wp_pagenavi', __NAMESPACE__ . '\\gc_pagination', 10, 2 );
function gc_pagination($html) {
$out = '';
$out = str_replace('<div','',$html);
$out = str_replace('class=\'wp-pagenavi\'>','',$out);
@lincolnlemos
lincolnlemos / WordPress Menu
Last active April 20, 2018 19:35
Full screen responsive bootstrap menu with WordPress
<nav id="navmenu" class="navbar navbar-expand-lg navbar-full navbar-light animation-close-toggle w-100">
<a class="navbar-brand col" href="<?php echo get_home_url(); ?>">
Brand
</a>
<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span></span><span></span><span></span>
</button>
<?php
@lincolnlemos
lincolnlemos / index.php
Created September 13, 2018 19:06
GSAP SmoothScroll
<div class="viewport">
<div id="scroll-container">
<!-- content -->
</div> <!-- #scroll-container -->
</div> <!-- .view-port -->
@lincolnlemos
lincolnlemos / query.txt
Last active March 22, 2023 22:09
CEE - To date policies/jurisdictions GraphQL query
// Request URL: https://explorer-api.localenergycodes.com/api/graphql
{
policies_count: policies(
where: [{column: "exclude_in_report", value: "false"}]
count: "id"
orderBy: [{column: "count_total", order: "DESC"}]
) {
count_total
}