Return to Snippet

Revision: 50858
at September 14, 2011 00:13 by distribuida


Updated Code
/*------------- WIDGETS --------------*/
if (function_exists('register_sidebar')) {
    register_sidebar(array(
        'name' => 'Sidebar Widgets',
        'id'   => 'sidebar-widgets',
        'description'   => 'These are widgets for the sidebar.',
        'before_widget' => '<div id="%1$s" class="widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h2>',
        'after_title'   => '</h2>'
    ));
}


/*------------- IMAGES --------------*/
//Prevent post images from being displayed on homepage
add_filter('the_content','wpi_image_content_filter',11);
function wpi_image_content_filter($content){
    if (is_home() || is_front_page()){
      $content = preg_replace("/<img[^>]+\>/i", "", $content);
    }
    return $content;
}

Revision: 50857
at September 6, 2011 18:52 by distribuida


Initial Code
/*-------------
CREAR WIDGESTS
--------------*/
if (function_exists('register_sidebar')) {
    register_sidebar(array(
        'name' => 'Sidebar Widgets',
        'id'   => 'sidebar-widgets',
        'description'   => 'These are widgets for the sidebar.',
        'before_widget' => '<div id="%1$s" class="widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h2>',
        'after_title'   => '</h2>'
    ));
}

Initial URL


Initial Description


Initial Title
wordpress: funciones útiles para functions.php

Initial Tags


Initial Language
PHP