This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IPs whitelist - block | |
# deny all Ips | |
# allow only certain IPs or IP range | |
ErrorDocument 403 /error403.html | |
order deny,allow | |
deny from all | |
allow from xx.xx.xx.xx | |
allow from 55.99.66.111 | |
allow from 55.99.66.0/23 | |
allow from 55.99.66.0/24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$uri = 'http://www.dominio.com/wp-json/wp/v2/posts/?page=1&per_page=3'; | |
$json = file_get_contents($uri); | |
$posts= json_decode($json); | |
echo "<h1>Listado de entradas</h1><ul>"; | |
foreach ($posts as $post) { | |
echo "<h2><a href='" . $post->link . "'>" . $post->title->rendered . "</a></h2>\n"; | |
echo "<p>" . $post->excerpt->rendered . "</p>"; | |
echo "<p><a href='" . $post->link . "'>Enlace directo</a></p>\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Añadir Shortcode | |
function dummyimage_shortcode_function( $atts ) { | |
// Atributos | |
$atts = shortcode_atts( | |
array( | |
'width' => '600', | |
'height' => '300', | |
'background' => 'eeeeee', | |
'text' => 'ffffff', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redirect from old domain to new domain | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR] | |
RewriteCond %{HTTP_HOST} ^www.olddomain.com$ | |
RewriteRule (.*)$ https://www.newdomain.com/$1 [R=301,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// default task | |
gulp.task('default', ['build', 'watch']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// watch for file changes | |
gulp.task('watch', ['browsersync'], () => { | |
// page changes | |
gulp.watch(php.src, ['php'], browsersync ? browsersync.reload : {}); | |
// image changes | |
gulp.watch(images.src, ['images']); | |
// CSS changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Browsersync options | |
const syncOpts = { | |
proxy : 'localhost', | |
files : dir.build + '**/*', | |
open : false, | |
notify : false, | |
ghostMode : false, | |
ui: { | |
port: 8001 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// recopilar acciones | |
gulp.task('build', ['php', 'css', 'js']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JavaScript settings | |
const js = { | |
src : dir.src + 'js/**/*', | |
build : dir.build + 'js/', | |
filename : 'scripts.js' | |
}; | |
// JavaScript processing | |
gulp.task('js', () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CSS settings | |
var css = { | |
src : dir.src + 'scss/style.scss', | |
watch : dir.src + 'scss/**/*', | |
build : dir.build, | |
sassOpts: { | |
outputStyle : 'nested', | |
imagePath : images.build, | |
precision : 3, | |
errLogToConsole : true |
NewerOlder