A Pen by Mrfoxtalbot on CodePen.
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 custom_pre_get_posts_query( $q ) { | |
$tax_query = (array) $q->get( 'tax_query' ); | |
$tax_query[] = array( | |
'taxonomy' => 'product_cat', | |
'field' => 'slug', | |
'terms' => array( 'clothing' ), // Don't display products in the clothing category on the shop page. | |
'operator' => 'NOT IN' | |
); |
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
#Al tener un SSL con SNI o Let's Encrypt, redsys no devuelve bien el estado del pedido pago y lo deja "En Espera" | |
#Esto se produce porque redsys no es compatible con estos protocolos, por lo tanto hay que saltear el https: en la | |
#respuesta de redsys. La solución es en el plugin (https://wordpress.org/plugins/woocommerce-sermepa-payment-gateway/) | |
#elegir el Protocolo para notificaciones HTTP y en el .htacces añadir una exclusión a la regla que redirige de | |
#HTTP a HTTPS. | |
# Enviar trafico HTTP a HTTPS | |
RewriteEngine On | |
# Si la cadena de consulta no contiene wc-api=WC_MyRedsys | |
RewriteCond %{QUERY_STRING} !wc-api=WC_MyRedsys [NC] |
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 | |
/** | |
* Get the latest hierarchical taxonomy children of a post | |
* | |
* @author Mauricio Gelves <[email protected]> | |
* @param $post_id int Post ID | |
* @return array | |
*/ | |
function get_last_children_taxonomy_in_post( $post_id, $taxonomy = 'category'){ |
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 | |
/** | |
* Get first paragraph from a WordPress post. Use inside the Loop. | |
* | |
* @param $class string optional class name to include in the paragraph | |
* @return string | |
*/ | |
function get_first_paragraph( $class = '' ){ | |
global $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
$space-inset-default = 16px 16px 16px 16px; | |
$space-inset-xs = 4px 4px 4px 4px; | |
$space-inset-s = 8px 8px 8px 8px; | |
$space-inset-m = 16px 16px 16px 16px; | |
$space-inset-l = 32px 32px 32px 32px; | |
$space-inset-xl = 64px 64px 64px 64px; | |
$space-stack-default = 0 0 16px 0; | |
$space-stack-xs = 0 0 4px 0; | |
$space-stack-s = 0 0 8px 0; | |
$space-stack-m = 0 0 16px 0; |
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
Try this. Add the code below to your functions.php file - | |
add_shortcode('cat_description', 'my_cat_description_shortcode'); | |
function my_cat_description_shortcode($atts){ | |
$a = shortcode_atts( array( | |
'id' => 0, | |
), $atts ); | |
return category_description($a['id']); |
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
Movable Type has never been Free Software, as defined by the Free Software | |
Foundation. It has never been open source software, as defined by the Open | |
Source Initiative. Six Apart survived and thrived in the blogging community | |
because Movable Type was “free enough.” | |
… | |
Many people misunderstand | |
Free Software and the GNU General Public License. Many people equate the GPL to | |
the boogeyman, because it’s “viral”, and that sounds like a bad thing. |
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_shortcode( 'areas', 'custom_query_shortcode' ); | |
function custom_query_shortcode( $atts ) { | |
// EXAMPLE USAGE: | |
// [areas show_posts="100" post_type="page" post_parent="246"] | |
// Defaults | |
$defaults = array( | |
"show_posts" => 100, | |
"post_type" => 'page', |
NewerOlder