Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Elias Faiçal eliasfaical

🏠
Working from home
View GitHub Profile
View post-blog-pagination.php
<?php
/**
* Template Name: Blog
*/
get_header();
?>
<main id="main" class="site-main innerPage">
<section class="banner-innerPage" style="background-image: url(<?php echo get_template_directory_uri(); ?>/assets/images/banner-conteudo.jpg)">
<div class="container text-center">
@eliasfaical
eliasfaical / gulpfile.js
Created Jul 10, 2019 — forked from jasonyingling/gulpfile.js
A simple gulpfile setup for modern JavaScript and SASS
View gulpfile.js
const { src, dest, watch } = require('gulp');
const sass = require('gulp-sass');
const minifyCSS = require('gulp-csso');
const babel = require('gulp-babel');
const concat = require('gulp-concat');
const browserSync = require('browser-sync').create();
function css() {
return src('./sass/*.scss', { sourcemaps: true })
.pipe(sass())
@eliasfaical
eliasfaical / webstoemp-gulpfile.js
Created Apr 22, 2019 — forked from jeromecoupe/webstoemp-gulpfile.js
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
View webstoemp-gulpfile.js
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@eliasfaical
eliasfaical / Instructions: How to enqueue the CSS in your theme
Created Jan 30, 2019 — forked from gugaalves/custom-login-styles.css
WordPress - Customizing Login, Register and Lost Password pages
View Instructions: How to enqueue the CSS in your theme
STEPS:
1 - If the theme was not developd by you, first create a child theme (How to create a child theme? Read at https://codex.wordpress.org/Child_Themes) or else modifications will be lost when updating your theme.
2 - Add the following CSS file in your theme/child theme (better if you create a folder to add CSS there).
3 - Add the following snippet in your functions.php file:
function tpw_enqueue_custom_admin_style() {
echo '<link rel="stylesheet" type="text/css" href="' . get_stylesheet_directory_uri() . '/css/admin/custom-login-styles.css" />';
}
View paginacao.php
<?php
$category = get_the_category();
$args_post = array(
'post_type' => 'post',
'posts_per_page' => 16,
'paged' => get_query_var('paged') ? get_query_var('paged') : 1
);
$query_post = new WP_Query( $args_post );
@eliasfaical
eliasfaical / iis-web.config
Created Nov 2, 2018 — forked from Toddses/iis-web.config
Example web.config for WordPress on IIS
View iis-web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.php" />
</files>
</defaultDocument>
<rewrite>
View CPT
<?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 Jun 13, 2018 — forked from crondeau/ACF-img-size
Display different image size using ACF
View ACF-img-size
//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; ?>
View get_term.php
<?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 Jan 25, 2018 — forked from danilowm/gist:bb6f216dd018ae68a803
web.config wordpress em hospedagem Windows
View gist:edd425ae40af1bc5e615d3077b54d712
<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>