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 | |
// Ejemplo complejo. Post Type 'historia', con un campo 'fecha_de_entrega' numérico (YYYYMMDD), y otro campo 'pila'. | |
$args = array( | |
'post_type' => 'historia', | |
'meta_key' => 'fecha_de_entrega', | |
'orderby' => 'meta_value_num', | |
'nopaging' => 'true', | |
'order' => 'ASC', |
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 | |
//** Admin Email Alerts for WordPress | |
// Original @ Josh Lobe - WP Admin Alerts For Profile Updates | |
// http://pastebin.com/XY4bgiZX | |
// WangGuard version @ Rafa Poveda | |
// https://gist.github.com/bi0xid/cd1896f7be881d02398f | |
/* |
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
.entry-content { | |
-webkit-hyphens: none; | |
-moz-hyphens: none; | |
-ms-hyphens: none; | |
hyphens: none; | |
} |
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
<html> | |
<head> | |
<title>TITLE</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0 maximum-scale=1.0" /> | |
<style type="text/css"> | |
body {width:100%;height:100%;margin:0;overflow:hidden;background-color:#252525;} | |
#iframe {position:absolute;left:0px;top:0px;} | |
</style> | |
</head> | |
<body> |
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 | |
add_filter( 'get_pages', 'add_my_cpt' ); | |
function add_my_cpt( $pages ) | |
{ | |
$my_cpt_pages = new WP_Query( array( 'post_type' => 'my_cpt' ) ); | |
if ( $my_cpt_pages->post_count > 0 ) | |
{ | |
$pages = array_merge( $pages, $my_cpt_pages->posts ); | |
} |
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 | |
* The WordPress Query class. | |
* @link http://codex.wordpress.org/Function_Reference/WP_Query | |
* | |
*/ | |
$args = array( | |
//Post & Page Parameters | |
'p' => 1, | |
'name' => 'hello-world', |
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 | |
add_filter('upload_mimes', 'custom_upload_mimes'); | |
function custom_upload_mimes ( $existing_mimes = array() ) { | |
// add your extension to the array | |
$existing_mimes['patch'] = 'text/plain'; | |
$existing_mimes['diff'] = 'text/plain'; | |
$existing_mimes['po'] = 'text/plain'; | |
$existing_mimes['conf'] = 'text/plain'; | |
$existing_mimes['mo'] = 'text/plain'; | |
$existing_mimes['rtf'] = 'text/rtf'; |
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
.htaccess | |
wp-content/uploads/ | |
wp-content/blogs.dir/ | |
wp-content/upgrade/ | |
wp-content/backup-db/ | |
wp-content/advanced-cache.php | |
wp-content/wp-cache-config.php | |
sitemap.xml | |
*.log | |
wp-content/cache/ |
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
window.onload = function () { | |
document.getElementById("commentform").onkeydown = function (e) { | |
if (e.keyCode == 13 && e.ctrlKey) { // keyCode 13 is Enter | |
document.getElementById("submit").click(); // submit the form by hitting ctrl + enter | |
// alert(e.keyCode); // to know other keyCodes of each keys | |
return false; // preventing default action | |
} | |
if (e.keyCode == 13 && e.metaKey) { // keyCode 13 is Enter | |
document.getElementById("submit").click(); // submit the form by hitting cmd + enter | |
// alert('test'); // to know other keyCodes of each keys |
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 | |
$contador = $_GET['c']; | |
// we can use any top number we need | |
if ( $contador >= 100 ) { | |
echo 'script terminado'; | |
} else { | |
if ( $contador == '' ) | |
$contador = 0; |
OlderNewer