Skip to content

Instantly share code, notes, and snippets.

Elias Faiçal eliasfaical

View GitHub Profile
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>
View Arquitetura.md

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
View Comandos Laravel
# composer install
# php artisan key:generate
# php artisan migrate --seed
# php artisan migrate:refresh --seed (*)
# php artisan passaport:install
View 1-pods-loop-general-example.php
<?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 ) {
You can’t perform that action at this time.