This file contains hidden or 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 | |
// load all 'category' terms for the post | |
$terms = get_the_terms( get_the_ID(), 'nombre_taxonomia'); | |
foreach ( $terms as $term ) { | |
echo ' <div class="tax-icons">'; | |
// we will use the first term to load ACF data from | |
if( !empty($terms) ) { | |
$term = array_pop($terms); | |
$custom_field = get_field('nombre_campo_icono', $term ); | |
echo '<img src="'; |
This file contains hidden or 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta http-equiv="refresh" content="0;URL=../new-page.htm" /> | |
<title>Redirect to... title of new-page</title> | |
</head> | |
<body> | |
<h1>Re-directing...</h1> | |
<p>You are being re-directed, if nothing happens, please <a href="../new-page.htm">follow this link</a></p> |
This file contains hidden or 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 | |
//You can set the value of this constant in your wp-config.php like this: | |
define('WPCF7_LOAD_JS', false); | |
//Likewise, you can control the loading of the CSS stylesheet with WPCF7_LOAD_CSS. Contact Form 7 does not load the CSS stylesheet when the value of WPCF7_LOAD_CSS is false (default: true). You can set it in the wp-config.php like this: | |
define('WPCF7_LOAD_CSS', false); | |
//Or, you can also disable the loading of the JavaScript and CSS by adding a few lines of code into your theme’s functions.php file, like this: | |
add_filter( 'wpcf7_load_js', '__return_false' ); | |
add_filter( 'wpcf7_load_css', '__return_false' ); |
This file contains hidden or 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_action( 'wp_footer', 'mycustom_wp_footer' ); | |
function mycustom_wp_footer() { | |
?> | |
<script type="text/javascript"> | |
document.addEventListener( 'wpcf7mailsent', function( event ) { | |
if ( '947' == event.detail.contactFormId ) { // Sends sumissions on form 947 to the first thank you page | |
location = 'https://www.example.com/thank-you-1/'; | |
} else if ( '1070' == event.detail.contactFormId ) { // Sends submissions on form 1070 to the second thank you page | |
location = 'https://www.example.com/thank-you-2/'; |
This file contains hidden or 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 | |
$urldelaudio = get_field('nombre_campo_audio'); | |
echo do_shortcode('[audio mp3="'.$urldelaudio.'"][/audio]'); | |
?> | |
// Tiene que haber una manera más elengate y sencilla, pero esto funciona. |
This file contains hidden or 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 | |
function image_crop_dimensions($default, $orig_w, $orig_h, $new_w, $new_h, $crop){ | |
if ( !$crop ) return null; // let the wordpress default function handle this | |
$aspect_ratio = $orig_w / $orig_h; | |
$size_ratio = max($new_w / $orig_w, $new_h / $orig_h); | |
$crop_w = round($new_w / $size_ratio); | |
$crop_h = round($new_h / $size_ratio); |
This file contains hidden or 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 | |
function rsssl_exclude_http_url($html) { | |
$html = str_replace( | |
'https://example.com/?wc-api=WC_Sermepa', | |
'http://example.com/?wc-api=WC_Sermepa', $html); | |
return $html; | |
} | |
add_filter('rsssl_fixer_output','rsssl_exclude_http_url'); | |
// Sources: |
This file contains hidden or 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 (qtrans_getLanguage() == 'en') { ?> | |
<!-- stuff for English --> | |
<?php } elseif (qtrans_getLanguage() == 'es') { ?> | |
<!-- other stuff Spanish --> | |
<?php } ?> |
This file contains hidden or 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 | |
$term_id = get_queried_object()->term_id; | |
$post_id = 'nombretaxonomia_'.$term_id; | |
$customfield = get_field('nombre_del_campo_acf', $post_id); | |
echo $customfield; | |
?> | |
// Es necesario la barra baja despues del nombre de la taxonomia, para concatenar el ID del termino correctamente |
This file contains hidden or 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
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`) | |
VALUES ('username', MD5('unpassword123'), 'Nombre Apellido', '[email protected]', '0'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) | |
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); | |
// Surce: Cybmeta https://cybmeta.com/crear-administrador-en-wordpress-desde-mysql |