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
// Widget Base Code | |
add_action("widgets_init", array('Widget_name', 'register')); | |
class Widget_name { | |
function control(){ | |
echo 'I am a control panel'; | |
} | |
function widget($args){ | |
echo $args['before_widget']; |
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
<!-- Angular ng-show Basic Example --> | |
<button ng-click="mostrarInput()">Contacto</button> | |
<input type="text" placeholder="Contacto" ng-show="mostrar"> | |
<script> | |
var u87 = angular.module( 'u87', [] ); | |
u87.controller( 'mainController',['$scope', function($scope) { |
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 | |
$args = array( | |
'post_type' => 'page', | |
'posts_per_page' => '3', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'localizacion', | |
'field' => 'slug', | |
'terms' => 'home' | |
) |
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
/** | |
* Recibe el contenido y el número de caracteres y corta ese contenido por ese número pasado. | |
* | |
* @param $content | |
* @param $letter_count | |
*/ | |
function cortar_contenido( $content , $letter_count ){ | |
$striped_content = strip_shortcodes($content); | |
$striped_content = strip_tags($striped_content); | |
$excerpt = mb_substr($striped_content, 0, $letter_count ); |
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
function paginador() { | |
global $wp_query; | |
$int = 999999999; | |
echo paginate_links( array( | |
'base' => str_replace( $int, '%#%', esc_url( get_pagenum_link( $int ) ) ), | |
'format' => '?paged=%#%', | |
'prev_text' => __(' Anterior '), | |
'next_text' => __(' Siguiente '), |
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
function validaSoloNumeros() { | |
if ((event.keyCode < 48) || (event.keyCode > 57)) | |
event.returnValue = false; | |
} |
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
function post_prev_next() { | |
echo '<div class="paginador">'; | |
$prev_post = get_previous_post(); | |
if ( !empty( $prev_post ) ) : | |
echo '<div class="post-prev"> | |
<a href="'; echo get_permalink( $prev_post->ID ); echo '">Anterior</a> | |
</div>'; | |
endif; |
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
add_action( 'add_meta_boxes', 'post_options' ); | |
add_action( 'save_post', 'post_options_save_data' ); | |
function post_options() { | |
add_meta_box('post_meta_box_mobile', 'Título de la sección', 'post_meta_box_mobile', 'post', 'normal', 'high'); | |
} | |
function post_meta_box_mobile($post) { |
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
drupal_set_html_head('<script type="text/javascript" src="/..ruta../functions.js"></script>'); | |
// Landing 1 Submit | |
if (isset($_POST['submit'])) { | |
$check = $_POST['check']; | |
if (!empty($check)) { | |
$n = count($check); |
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
// Widget Base Code | |
class My_Widget extends WP_Widget { | |
function My_Widget() { | |
// Nombre, decsripción, etc. del widget | |
parent::WP_Widget(false, $name = 'Nombre', $widget_options = array('description' => 'Descripción')); | |
} | |
function widget($args, $instance) { | |
// Muestra el contenido del widget |
OlderNewer