Foros del Web » Creando para Internet » Sistemas de gestión de contenidos » WordPress »

[SOLUCIONADO] Wordpress: Si elimino footer no me funciona plugin Lazy Load

Estas en el tema de Wordpress: Si elimino footer no me funciona plugin Lazy Load en el foro de WordPress en Foros del Web. Hola amigos, resulta que si elimino el footer del código el plugin Lazyload deja de funcionar y no se ven las fotos en el blog. ...
  #1 (permalink)  
Antiguo 11/02/2014, 05:57
Avatar de Luisa29  
Fecha de Ingreso: enero-2013
Mensajes: 193
Antigüedad: 11 años, 1 mes
Puntos: 4
Pregunta Wordpress: Si elimino footer no me funciona plugin Lazy Load

Hola amigos, resulta que si elimino el footer del código el plugin Lazyload deja de funcionar y no se ven las fotos en el blog. ¿Cómo podría eliminar u ocultar el footer sin que suceda esto?

Código del footer:

Cita:
<?php
/**
* The template for displaying the footer
*
* Contains footer content and the closing of the #main and #page div elements.
*
* @package WordPress
* @subpackage Twenty_Thirteen
* @since Twenty Thirteen 1.0
*/
?>

</div><!-- #main -->
<footer id="colophon" class="site-footer" role="contentinfo">
<?php get_sidebar( 'main' ); ?>

<div class="site-info">
<?php do_action( 'twentythirteen_credits' ); ?>
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentythirteen' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentythirteen' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentythirteen' ), 'WordPress' ); ?></a>
</div><!-- .site-info -->
</footer><!-- #colophon -->
</div><!-- #page -->

<?php wp_footer(); ?>
</body>
</html>
El código del índice, si elimino de él <?php get_footer(); ?> sucede lo mismo:

Cita:
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme and one of the
* two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* For example, it puts together the home page when no home.php file exists.
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Thirteen
* @since Twenty Thirteen 1.0
*/

get_header(); ?>

<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php if ( have_posts() ) : ?>

<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>

<?php twentythirteen_paging_nav(); ?>

<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>

</div><!-- #content -->
</div><!-- #primary -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>
El código del plugin Lazyload:

Cita:
<?php
/**
* Plugin Name: Lazy Load
* Description: Lazy load images to improve page load times. Uses jQuery.sonar to only load an image when it's visible in the viewport.
* Version: 0.5
*
* Code by the WordPress.com VIP team, TechCrunch 2011 Redesign team, and Jake Goldman (10up LLC).
* Uses jQuery.sonar by Dave Artz (AOL): http://www.artzstudio.com/files/jque.../jquery.sonar/
*
* License: GPL2
*/

if ( ! class_exists( 'LazyLoad_Images' ) ) :

class LazyLoad_Images {

const version = '0.5';

static function init() {
if ( is_admin() )
return;

add_action( 'wp_enqueue_scripts', array( __CLASS__, 'add_scripts' ) );
add_filter( 'the_content', array( __CLASS__, 'add_image_placeholders' ), 99 ); // run this later, so other content filters have run, including image_add_wh on WP.com
add_filter( 'post_thumbnail_html', array( __CLASS__, 'add_image_placeholders' ), 11 );
add_filter( 'get_avatar', array( __CLASS__, 'add_image_placeholders' ), 11 );
}

static function add_scripts() {
wp_enqueue_script( 'wpcom-lazy-load-images', self::get_url( 'js/lazy-load.js' ), array( 'jquery', 'jquery-sonar' ), self::version, true );
wp_enqueue_script( 'jquery-sonar', self::get_url( 'js/jquery.sonar.min.js' ), array( 'jquery' ), self::version, true );
}

static function add_image_placeholders( $content ) {
// Don't lazyload for feeds, previews, mobile
if( is_feed() || is_preview() || ( function_exists( 'is_mobile' ) && is_mobile() ) )
return $content;

// Don't lazy-load if the content has already been run through previously
if ( false !== strpos( $content, 'data-lazy-src' ) )
return $content;

// In case you want to change the placeholder image
$placeholder_image = apply_filters( 'lazyload_images_placeholder_image', self::get_url( 'images/1x1.trans.gif' ) );

// This is a pretty simple regex, but it works
$content = preg_replace( '#<img([^>]+?)src=[\'"]?([^\'"\s>]+)[\'"]?([^>]*)>#', sprintf( '<img${1}src="%s" data-lazy-src="${2}"${3}><noscript><img${1}src="${2}"${3}></noscript>', $placeholder_image ), $content );

return $content;
}

static function get_url( $path = '' ) {
return plugins_url( ltrim( $path, '/' ), __FILE__ );
}
}

function lazyload_images_add_placeholders( $content ) {
return LazyLoad_Images::add_image_placeholders( $content );
}

LazyLoad_Images::init();

endif;
¿Cómo podría eliminar el footer (u ocultarlo) sin que suceda esto? Gracias !
  #2 (permalink)  
Antiguo 11/02/2014, 12:58
Avatar de Luisa29  
Fecha de Ingreso: enero-2013
Mensajes: 193
Antigüedad: 11 años, 1 mes
Puntos: 4
Respuesta: Wordpress: Si elimino footer no me funciona plugin Lazy Load

Lo he solucionado, era problema de la plantilla que estaba usando, ahora tengo otra y perfecto !!

Cierro tema como solucionado.

Etiquetas: aplicaciones-prefabricadas, elimino, footer, load, php, plugin
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:52.