Skip to content

Instantly share code, notes, and snippets.

View eliasfaical's full-sized avatar
🏠
Working from home

Elias Faiçal eliasfaical

🏠
Working from home
View GitHub Profile
<?php
// Register Custom Post Types
function register_custom_posts_cases() {
// Register Products
$products_labels = array(
'name' => 'Cases',
'singular_name' => 'Cases',
'menu_name' => 'Cases'
);
$products_args = array(
@eliasfaical
eliasfaical / ACF-img-size
Created June 13, 2018 15:11 — forked from crondeau/ACF-img-size
Display different image size using ACF
//To display an image using ACF, one would set the image custom field to image url and call the img as follows:
<?php if( get_field( 'field_name' ) ): ?>
<?php while( has_sub_field( 'field_name' ) ): ?>
<img src="<?php the_sub_field( 'image' ); ?>" alt="">
<?php endwhile; ?>
<?php
// Get terms for post
$terms = get_the_terms( $post->ID , 'oil' );
// Loop over each item since it's an array
if ( $terms != null ){
foreach( $terms as $term ) {
$term_link = get_term_link( $term, 'oil' );
// Print the name and URL
echo '<a href="' . $term_link . '">' . $term->name . '</a>';
@eliasfaical
eliasfaical / gist:edd425ae40af1bc5e615d3077b54d712
Created January 25, 2018 18:38 — forked from danilowm/gist:bb6f216dd018ae68a803
web.config wordpress em hospedagem Windows
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
@eliasfaical
eliasfaical / Arquitetura.md
Last active January 6, 2018 20:28
Arquitetura

Arquitetura

Este código fonte é parte do projeto de treinamento da Gama Academy. O projeto é desenvolvido usando Angular 2x.

O endereço oficial do repositório é http://git.avanade.gama.academy/repo/NTYYHTPAV

Contribuindo

  • Clone este repositório
# composer install
# php artisan key:generate
# php artisan migrate --seed
# php artisan migrate:refresh --seed (*)
# php artisan passaport:install
<?php
//set up pods::find parameters to limit to 5 items
$param = array(
'limit' => 5,
);
//create pods object
$pods = pods('pod_name', $params );
//check that total values (given limit) returned is greater than zero
if ( $pods->total() > 0 ) {
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<identity password="ragi@2015" userName="ragibeneficios" />
</system.web>
<system.webServer>
<urlCompression doDynamicCompression="false" />
<rewrite>
<rules>
<rule name="WordPress: http://www.ragibeneficios.com.br" patternSyntax="Wildcard">
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Usuario_model extends CI_Model{
//verifica se o usuario já está no banco
//se o usuario ja existir RETORNA 1 se não existir RETORNA 0
function buscaUsuario($login) {
$this->db->select("*");
$this->db->from("usuario");
@eliasfaical
eliasfaical / git.md
Created June 2, 2017 21:05 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

#GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda