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
// Desabilita F12 | |
document.onkeypress = function (event) { | |
event = (event || window.event); | |
if (event.keyCode == 123) { | |
//alert('No F-12'); | |
return false; | |
} | |
} | |
document.onmousedown = function (event) { | |
event = (event || window.event); |
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 | |
// Filtrar Post por Date Range | |
class kuafDateRange{ | |
function __construct(){ | |
// if you do not want to remove default "by month filter", remove/comment this line | |
add_filter( 'months_dropdown_results', '__return_empty_array' ); | |
// include CSS/JS, in our case jQuery UI datepicker |
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 | |
// Desabilitar accesso publico a REST API /wp-json | |
function kuaf_restricted_rest_api_access( $access ) { | |
return new WP_Error( 'rest_cannot_access', 'Lo siento pero he bloqueado el REST API de la website para evitar el accesso publico al contenido de la website', array( | |
'status' => 403 | |
) ); | |
} | |
add_filter( 'rest_authentication_errors', 'kuaf_restricted_rest_api_access' ); |
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
<div class="alert alert-info"> | |
<p> | |
<?php | |
$numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'"); | |
if (0 < $numcomms) $numcomms = number_format($numcomms); echo "Hay <span>".$numcomms."</span> comentarios en total en "; bloginfo('name'); | |
?> | |
</p> | |
</div> |
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
<!-- | |
This technique is required in order to show content from a page(usually home(English) or inicio(Spanish) in the front-page.php file) | |
--> | |
<!-- The main content div --> | |
<?php global $post; ?> | |
<?php if($post->post_content): ?> | |
<?php if(have_posts()) : the_post(); ?> | |
<div class="container"> | |
<div class="row"> | |
<article> |
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 | |
if (!defined('BASEPATH')) | |
exit('No direct script access allowed'); | |
class Template | |
{ | |
var $ci; | |
function __construct() |
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 | |
// Funcion para buscador. El input de buscar buscara la keyword unicamente en los post | |
function search_filter( $query ) { | |
if ( !is_admin() && $query->is_main_query() ) { | |
if ( $query->is_search ) { | |
$query->set( 'post_type', array( 'post ', 'portfolios' , 'videos' , 'clients' , 'snippets' ) ); | |
} | |
} | |
} | |
add_action( 'pre_get_posts','search_filter' ); |