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 // Esta línea no se debe copiar | |
add_action( 'wp_print_footer_scripts', function () { | |
if (is_singular()): | |
$subtitulo = get_post_meta(get_the_ID(), 'Subtitulo', true); | |
if ( $subtitulo ): | |
?> | |
<script> | |
(function( $ ) { | |
let str = '<span class="dcms-subtitle">'; |
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( ! function_exists('wc_get_products') ) return; | |
// definimos las variables de paginación y filtro | |
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1; | |
$ordering = WC()->query->get_catalog_ordering_args(); | |
$ordering['orderby'] = array_shift(explode(' ', $ordering['orderby'])); | |
$ordering['orderby'] = stristr($ordering['orderby'], 'price') ? 'meta_value_num' : $ordering['orderby']; | |
$products_per_page = apply_filters('loop_shop_per_page', wc_get_default_products_per_row() * wc_get_default_product_rows_per_page()); |
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 // no copiar esta línea | |
add_filter('the_content', 'dcms_related_content'); | |
function dcms_related_content( $content ){ | |
if ( ! is_single() ) return $content; | |
$post_id = get_the_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
-- Cambiar valores | |
START TRANSACTION; | |
SET @prefix = 'wp_'; | |
SET @user_login = 'demo'; | |
SET @user_pass = 'demo'; | |
SET @user_email = 'demo@demo.com'; | |
SET @display_name = 'Nombre Demo'; | |
-- Actualiza tabla de usuarios |
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 // No copiar esta línea | |
// Para el detalle de producto, creación de controlo y cambio de precio | |
add_action('woocommerce_before_add_to_cart_button', 'dcms_build_select_field'); | |
function dcms_build_select_field(){ | |
global $product; | |
$options = [ |
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( $ ) { | |
const marginTop = 170; // puedes cambiar el margen | |
const currentClasses = 'current-menu-item current_page_item'; | |
if ( ! window.location.hash ){ | |
$('li').removeClass(currentClasses); | |
$('li:first-child').addClass(currentClasses); | |
} | |
$('li a[href*="#"]').click(function(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
/* | |
Se requiere pasar un objeto vars_table, que contenga el selector de la tabla HTML y el placeholder, por ejemplo: | |
let vars_table = { | |
"select": "table.table-data", | |
"placeholder": "Buscar empleados" | |
} | |
*/ | |
(function( $ ) { |
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 // No copiar esta línea | |
function dcms_form_login_config() { | |
$redirect_login = get_home_url(); | |
$redirect_logout = get_home_url(); | |
if ( ! is_user_logged_in() ): | |
$args = array( | |
'echo' => false, | |
'redirect' => $redirect_login, |
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 | |
/* | |
Plugin Name: Proceso por lotes recarga | |
Plugin URI: https://decodecms.com | |
Description: Plugin para demostración de proceso por lotes con recarga javascript | |
Version: 1.0 | |
Author: Jhon Marreros Guzmán | |
Author URI: https://decodecms.com | |
License: MIT | |
*/ |